{"id":18300778,"url":"https://github.com/stratosblue/languageidentification","last_synced_at":"2025-04-12T14:04:51.116Z","repository":{"id":65649501,"uuid":"410532943","full_name":"stratosblue/LanguageIdentification","owner":"stratosblue","description":".NET Port of Language Identification Library for langid-java. 移植自langid-java的语言识别库。","archived":false,"fork":false,"pushed_at":"2024-01-19T02:57:57.000Z","size":2592,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T08:37:30.223Z","etag":null,"topics":["langid","langid-csharp","langid-dotnet","language-detection","language-identification"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stratosblue.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-26T11:27:45.000Z","updated_at":"2025-03-14T12:45:01.000Z","dependencies_parsed_at":"2024-12-23T02:11:49.189Z","dependency_job_id":"6afdda1c-ee85-4285-bb5e-28780942367f","html_url":"https://github.com/stratosblue/LanguageIdentification","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stratosblue%2FLanguageIdentification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stratosblue%2FLanguageIdentification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stratosblue%2FLanguageIdentification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stratosblue%2FLanguageIdentification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stratosblue","download_url":"https://codeload.github.com/stratosblue/LanguageIdentification/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578860,"owners_count":21127713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["langid","langid-csharp","langid-dotnet","language-detection","language-identification"],"created_at":"2024-11-05T15:13:21.585Z","updated_at":"2025-04-12T14:04:51.081Z","avatar_url":"https://github.com/stratosblue.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LanguageIdentification\n\n## Intro\n\n.NET Port of Language Identification Library for [langid-java](https://github.com/carrotsearch/langid-java)。\n\n移植自[langid-java](https://github.com/carrotsearch/langid-java)的语言识别库，技术细节参见[langid-java](https://github.com/carrotsearch/langid-java)、[langid.py](https://github.com/saffsd/langid.py)。\n\n - 支持`.netstandard2.0`+；\n\n## 如何使用\n\n### 安装Nuget包\n\n```PowerShell\nInstall-Package LanguageIdentification\n```\n\n### 快速使用\n\n----\n\n1. 通过手动创建实例使用\n```C#\nvar langIdClassifier = new LanguageIdentificationClassifier();\nlangIdClassifier.Append(\"Hello\");\nusing var result = langIdClassifier.Classify();\nConsole.WriteLine(result);\n```\n\n - 实例`不是线程安全`的；\n - 实例复用进行新的检测前，需要调用`Reset()`方法；\n\n----\n\n2. 通过静态方法使用\n```C#\nusing var result = LanguageIdentificationClassifier.Classify(\"Hello\");\nConsole.WriteLine(result);\n```\n\n - 静态方法是`线程安全`的，内部使用了默认的`LanguageIdentificationClassifier`池 - `LanguageIdentificationClassifierPool.Default` 进行处理；\n\n\n### 特殊用法\n\n----\n\n1. 只加载部分语言支持\n```C#\nvar classifier = new LanguageIdentificationClassifier(\"zh\", \"en\");\nlangIdClassifier.Append(\"Hello\");\nusing var result = langIdClassifier.Classify();\nConsole.WriteLine(result);\n```\n - 速度会更快；\n - 返回的语言只会是已加载语言的其中一个；\n\n----\n\n2. 使用自己的模型数据\n```C#\nvar model = new LanguageIdentificationModel(langClasses, nb_ptc, nb_pc, dsa, dsaOutput);\nvar classifier = new LanguageIdentificationClassifier(model);\n```\n\n - 具体各个参数是什么意义。。不清楚。。自行研究源项目。。。\n\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstratosblue%2Flanguageidentification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstratosblue%2Flanguageidentification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstratosblue%2Flanguageidentification/lists"}