{"id":13413543,"url":"https://github.com/goodsign/libtextcat","last_synced_at":"2026-03-16T05:34:55.600Z","repository":{"id":5883191,"uuid":"7101004","full_name":"goodsign/libtextcat","owner":"goodsign","description":"Cgo binding for libtextcat C library","archived":false,"fork":false,"pushed_at":"2012-12-27T17:23:35.000Z","size":202,"stargazers_count":13,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-25T05:24:13.131Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goodsign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-10T21:21:47.000Z","updated_at":"2023-08-04T09:58:01.000Z","dependencies_parsed_at":"2022-09-01T12:50:53.034Z","dependency_job_id":null,"html_url":"https://github.com/goodsign/libtextcat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/goodsign/libtextcat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goodsign%2Flibtextcat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goodsign%2Flibtextcat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goodsign%2Flibtextcat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goodsign%2Flibtextcat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goodsign","download_url":"https://codeload.github.com/goodsign/libtextcat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goodsign%2Flibtextcat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28005408,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-07-30T20:01:42.819Z","updated_at":"2025-12-24T17:09:22.462Z","avatar_url":"https://github.com/goodsign.png","language":"Go","readme":"About\n==========\n\nCgo binding for libtextcat C library. Guaranteed compatibility with version 2.2.\n\nInstallation\n==========\n\nInstallation consists of several simple steps. They may be a bit different on your target system (e.g. require more permissions) so adapt them to the parameters of your system.\n\n### Get libtextcat C library code\n\n* Download original libtextcat archive from [libtextcat download section](http://software.wise-guys.nl/libtextcat/). \n* Unarchive it.\n\nNOTE: If this link is not working or there are some problems with downloading, there is a stable version 2.2 snapshot saved in [Downloads](https://github.com/downloads/goodsign/libtextcat/libtextcat-2.2.tar.gz).\n\n### Build and install libtextcat C library\n\nFrom the directory, where you unarchived libtextcat, run:\n\n```\n./configure\nmake\nsudo make install\nsudo ldconfig \n```\n\n### Install Go wrapper\n\n```\ngo get github.com/goodsign/libtextcat\ngo test github.com/goodsign/libtextcat (must PASS)\n```\n\nInstallation notes\n==========\n\nMake sure that you have your local library paths set correctly and that installation was successful. Otherwise, **go build** or **go test** may fail.\n\nlibtextcat is installed in your local library directory (e.g. **/usr/local/lib**) and puts its libraries there. This path should be registered in your system (using ldconfig or exporting LD_LIBRARY_PATH, etc.) or the linker would fail.\n\nUsage\n==========\n\n```go\ncat, err := NewTextCat(ConfigPath) // See 'Usage notes' section\n\nif nil != err {\n    // ... Handle error ...\n}\ndefer cat.Close()\n\nmatches, err := cat.Classify(text)\n\nif nil != err {\n    // ... Handle error ...\n}\n\n// Use matches. \n// NOTE: matches[0] is the best match.\n\n```\n\nUsage notes\n==========\n\nlibtextcat library needs to load language models to start guessing languages. These models are set using a configuration file and a number of language model (.lm) files.\n\nConfiguration file maps .lm files to identifiers used in the library. See [example](https://github.com/goodsign/libtextcat/blob/master/defaultcfg/conf.txt). Path to this file is specified in the **NewTextCat** call.\n\n.lm files contain language patterns and frequencies for a specified language. See [example](https://github.com/goodsign/libtextcat/blob/master/defaultcfg/english.lm). Paths to these files are specified in the config file above. They can be absolute or relative (to the caller).\n\nQuickstart\n----------\n\nTo immediately get started, copy **/defaultcfg** folder contents to the directory of your target project and use:\n\n```go\ncat, err := NewTextCat(\"defaultcfg/conf.txt\")\n```\n\nThis will give you a standard set of languages described in the **Default configuration** section below.\n\nDefault configuration\n----------\n\nThis package contains a default configuration (/defaultcfg) which is created to work in following conditions:\n\n* Utf-8 only languages\n* Language list is taken from [snowball](github.com/goodsign/snowball) package\n* Language identifiers are the same as in [snowball](github.com/goodsign/snowball) package\n\nThis configuration is meant to be used in pair with the [snowball](github.com/goodsign/snowball) package.\n\nMore info\n----------\n\nFor more information on libtextcat refer to the original [website](http://software.wise-guys.nl/libtextcat/), which contains links on theory and other details.\n\nlibtextcat Licence\n==========\n\nThe libtextcat library is released under the [BSD Licence](http://opensource.org/licenses/bsd-license.php)\n\n[LICENCE file](https://github.com/goodsign/libtextcat/blob/master/LICENCE_libtextcat)\n\nLicence\n==========\n\nThe goodsign/libtextcat binding is released under the [BSD Licence](http://opensource.org/licenses/bsd-license.php)\n\n[LICENCE file](https://github.com/goodsign/libtextcat/blob/master/LICENCE)","funding_links":[],"categories":["Natural Language Processing","自然语言处理","Relational Databases","Bot Building","Microsoft Office","\u003cspan id=\"自然语言处理-natural-language-processing\"\u003e自然语言处理 Natural Language Processing\u003c/span\u003e"],"sub_categories":["Morphological Analyzers","Uncategorized","暂未分类","形态分析","暂未分类这些库被放在这里是因为其他类别似乎都不适合。","交流","Advanced Console UIs","Strings","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodsign%2Flibtextcat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoodsign%2Flibtextcat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodsign%2Flibtextcat/lists"}