ja-itaiji


Nameja-itaiji JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/RjChiba/ja_itaiji
Summaryja-itaiji: handling Japanese 異体字 (itaiji), which are variant forms of kanji characters
upload_time2024-08-16 05:07:28
maintainerRyuji Chiba
docs_urlNone
authorRyuji Chiba
requires_python>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ja-itaiji

ja-itaiji is a Python package for handling Japanese 異体字 (itaiji), which are variant forms of kanji characters. This package allows you to find equivalent characters, check if two kanji characters or words are equivalent, and generate a list of similar words by replacing kanji with their itaiji.

## Features

* Get Itaiji Family: Retrieve a list of kanji characters that are equivalent to a given kanji.
* Check Kanji Equivalence: Determine whether two kanji characters are equivalent itaiji.
* Check Word Equivalence: Check if two words are equivalent within itaiji.
* Generate Similar Words: Generate a list of words by replacing each kanji with its equivalent itaiji.

## Installation

To install the package, use pip:
```shell
pip install ja-itaiji
```

## Usage
### Importing the Package
```python
from ja_itaiji import Itaiji
```

### Get Itaiji Family
Retrieve a list of kanji characters that are equivalent to a given kanji.
```python
family = Itaiji.get_family('漢')
print(family)  # Output: ['漢', '㵄', '漢', '汉']
```

### Check Kanji Equivalence
Determine whether two kanji characters are equivalent itaiji.
```python
is_equivalent = Itaiji.is_family('漢', '㵄')
print(is_equivalent)  # Output: True
```

### Check Word Equivalence
Check if two words are equivalent within itaiji.
```python
is_similar = Itaiji.is_similar('漢字', '汉字')
print(is_similar)  # Output: True
```

### Generate Similar Words
Generate a list of words by replacing each kanji with its equivalent itaiji.
```python
similar_words = Itaiji.get_similar('漢字')
print(similar_words)  # Output: ['漢字', '㵄字', '漢字', '汉字']
```

You can also specify the number of replacing.
```python
similar_words = Itaiji.get_similar("低頭思故郷", n=1)
print(similar_words)  # Output: ['低頭思故郷', '低頭思故鄕', '低頭思故乡', '低頭楒故郷', '低頭䰄故郷', '低頭恖故郷', '低头思故郷', '氐頭思故郷', '仾頭思故郷']
```

# Data
The package uses a JSON file (ja-itaiji.json) that contains mappings of kanji to their itaiji. Ensure that this file is located in the correct directory as specified by `ITAIJI_PATH`.

# License
This project is licensed under the MIT License. See the LICENSE file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/RjChiba/ja_itaiji",
    "name": "ja-itaiji",
    "maintainer": "Ryuji Chiba",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "manchuria.museum@gmail.com",
    "keywords": null,
    "author": "Ryuji Chiba",
    "author_email": "manchuria.museum@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f7/d0/5a405dddade3da42d4e69437f5918c84f98d8555eefbf60900f6ced70b85/ja_itaiji-1.0.2.tar.gz",
    "platform": null,
    "description": "# ja-itaiji\n\nja-itaiji is a Python package for handling Japanese \u7570\u4f53\u5b57 (itaiji), which are variant forms of kanji characters. This package allows you to find equivalent characters, check if two kanji characters or words are equivalent, and generate a list of similar words by replacing kanji with their itaiji.\n\n## Features\n\n* Get Itaiji Family: Retrieve a list of kanji characters that are equivalent to a given kanji.\n* Check Kanji Equivalence: Determine whether two kanji characters are equivalent itaiji.\n* Check Word Equivalence: Check if two words are equivalent within itaiji.\n* Generate Similar Words: Generate a list of words by replacing each kanji with its equivalent itaiji.\n\n## Installation\n\nTo install the package, use pip:\n```shell\npip install ja-itaiji\n```\n\n## Usage\n### Importing the Package\n```python\nfrom ja_itaiji import Itaiji\n```\n\n### Get Itaiji Family\nRetrieve a list of kanji characters that are equivalent to a given kanji.\n```python\nfamily = Itaiji.get_family('\u6f22')\nprint(family)  # Output: ['\u6f22', '\u3d44', '\ufa47', '\u6c49']\n```\n\n### Check Kanji Equivalence\nDetermine whether two kanji characters are equivalent itaiji.\n```python\nis_equivalent = Itaiji.is_family('\u6f22', '\u3d44')\nprint(is_equivalent)  # Output: True\n```\n\n### Check Word Equivalence\nCheck if two words are equivalent within itaiji.\n```python\nis_similar = Itaiji.is_similar('\u6f22\u5b57', '\u6c49\u5b57')\nprint(is_similar)  # Output: True\n```\n\n### Generate Similar Words\nGenerate a list of words by replacing each kanji with its equivalent itaiji.\n```python\nsimilar_words = Itaiji.get_similar('\u6f22\u5b57')\nprint(similar_words)  # Output: ['\u6f22\u5b57', '\u3d44\u5b57', '\ufa47\u5b57', '\u6c49\u5b57']\n```\n\nYou can also specify the number of replacing.\n```python\nsimilar_words = Itaiji.get_similar(\"\u4f4e\u982d\u601d\u6545\u90f7\", n=1)\nprint(similar_words)  # Output: ['\u4f4e\u982d\u601d\u6545\u90f7', '\u4f4e\u982d\u601d\u6545\u9115', '\u4f4e\u982d\u601d\u6545\u4e61', '\u4f4e\u982d\u6952\u6545\u90f7', '\u4f4e\u982d\u4c04\u6545\u90f7', '\u4f4e\u982d\u6056\u6545\u90f7', '\u4f4e\u5934\u601d\u6545\u90f7', '\u6c10\u982d\u601d\u6545\u90f7', '\u4efe\u982d\u601d\u6545\u90f7']\n```\n\n# Data\nThe package uses a JSON file (ja-itaiji.json) that contains mappings of kanji to their itaiji. Ensure that this file is located in the correct directory as specified by `ITAIJI_PATH`.\n\n# License\nThis project is licensed under the MIT License. See the LICENSE file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "ja-itaiji: handling Japanese \u7570\u4f53\u5b57 (itaiji), which are variant forms of kanji characters",
    "version": "1.0.2",
    "project_urls": {
        "Download": "https://github.com/RjChiba/ja_itaiji",
        "Homepage": "https://github.com/RjChiba/ja_itaiji"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56bfacabc232a779bbe11af9f465c946a45ee4821d7edda7f8cf9dc6db135a05",
                "md5": "f0eaa7682d0f0d22ce2972dd297c7511",
                "sha256": "0e8237ee9762c789c124ca29c1e7790367dc11e998f965c5c43de2517d715b62"
            },
            "downloads": -1,
            "filename": "ja_itaiji-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f0eaa7682d0f0d22ce2972dd297c7511",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 169788,
            "upload_time": "2024-08-16T05:07:26",
            "upload_time_iso_8601": "2024-08-16T05:07:26.766763Z",
            "url": "https://files.pythonhosted.org/packages/56/bf/acabc232a779bbe11af9f465c946a45ee4821d7edda7f8cf9dc6db135a05/ja_itaiji-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f7d05a405dddade3da42d4e69437f5918c84f98d8555eefbf60900f6ced70b85",
                "md5": "eb1f6d567487895154bbc79f8c55848b",
                "sha256": "91c766e0cf64fbc0126ab2e548da6147427f089469980412eb6482b049aa6acd"
            },
            "downloads": -1,
            "filename": "ja_itaiji-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "eb1f6d567487895154bbc79f8c55848b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 171756,
            "upload_time": "2024-08-16T05:07:28",
            "upload_time_iso_8601": "2024-08-16T05:07:28.811499Z",
            "url": "https://files.pythonhosted.org/packages/f7/d0/5a405dddade3da42d4e69437f5918c84f98d8555eefbf60900f6ced70b85/ja_itaiji-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-16 05:07:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "RjChiba",
    "github_project": "ja_itaiji",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ja-itaiji"
}
        
Elapsed time: 1.82070s