yakinori


Nameyakinori JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/morikatron/yakinori
Summaryyakinori is a tool for converting Kanji to hiragana, katakana, roma-ji.
upload_time2023-06-17 05:21:48
maintainer
docs_urlNone
authorHikaru Yamada
requires_python>=3.8
licenseMIT
keywords japanese converter japanese text preprocessing hiragana katakana kanji alphabet
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # yakinori
Japanese REAMED is here.  
https://github.com/morikatron/yakinori/blob/main/README_ja.md

Japanese Converter Kanji to Hiragana, Katakana, Latin alphabet.  

You can get the reading and pronunciation of Japanese sentences based on mecab-unidic-NEologd.  

## Test Environments
```
Ubuntu18.04
python==3.8.16
```

## Install
There are two options to install.
- Install Mecab and mecab-unidic-NEologd in your own environment  
- Use Docker


### Your Own Environment
#### For Ubuntu
##### Install Mecab
```bash
$ sudo apt update
$ sudo apt install mecab libmecab-dev mecab-ipadic-utf8
```

##### Install mecab-unidic-NEologd
```bash
$ git clone --depth 1 https://github.com/neologd/mecab-unidic-neologd.git
$ cd mecab-unidic-neologd
$ sudo ./bin/install-mecab-unidic-neologd -n -y

# show installed mecab-unidic-NEologd dictionary path
$ echo `mecab-config --dicdir`"/mecab-unidic-neologd"
> /usr/local/lib/mecab/dic/mecab-unidic-neologd

# If you want to make mecab-unidic-NEologd as defalut dictionary, run commands below.
$ echo "dicdir = `mecab-config --dicdir`/mecab-unidic-neologd" | sudo tee /etc/mecabrc
$ sudo cp /etc/mecabrc /usr/local/etc

```

##### Install yakinori
```bash
$ pip install yakinori
```

##### You can update the recent mecab-unidic-NEologd
```bash
$ sudo ./bin/install-mecab-unidic-neologd -n -y
$ echo "dicdir = `mecab-config --dicdir`/mecab-unidic-neologd" | sudo tee /etc/mecabrc
$ sudo cp /etc/mecabrc /usr/local/etc
```

#### Use Docker
```bash
$ docker pull morikayamada/yakinori
```

## How to use
### Import
```python
>>> from yakinori import Yakinori
```

### create Instance
#### Installed on your Own Environment
- If you made mecab-unidic-NEologd as defalut dictionary, you don't need to add dic_path.  
```python
>>> yakinori = Yakinori()
```
- If you did not make mecab-unidic-NEologd as defalut dictionary, add dic_path.  
```python
>>> yakinori = Yakinori(dic_path='path/to/mecab-unidic-NEologd') 
```
#### Using Docker
If you use Docker, you don't need to add dic_path.  
```python
>>> yakinori = Yakinori()
```

### Parse Sentence
```python
>>> sentence = "幽☆遊☆白書は最高の漫画です"
>>> parsed_list = yakinori.get_parsed_list(sentence)
```

### Get Reading
```python
# convert to hiragana
>>> hiragana_sentence = yakinori.get_hiragana_sentence(parsed_list)
>>> print(hiragana_sentence)
ゆうゆうはくしょはさいこうのまんがです

# convert to katakana
>>> katakana_sentence = yakinori.get_katakana_sentence(parsed_list)
>>> print(katakana_sentence)
ユウユウハクショハサイコウノマンガデス

# convert to Latin alphabet
>>> roma_sentence = yakinori.get_roma_sentence(parsed_list)
>>> print(roma_sentence)
yuuyuuhakushohasaikounomangadesu
```

### Get Pronunciation
```python
# convert to hiragana
>>> hiragana_sentence = yakinori.get_hiragana_sentence(parsed_list, is_hatsuon=True)
>>> print(hiragana_sentence)
ゆーゆーはくしょわさいこーのまんがです

# convert to katakana
>>> katakana_sentence = yakinori.get_katakana_sentence(parsed_list, is_hatsuon=True)
>>> print(katakana_sentence)
ユーユーハクショワサイコーノマンガデス

# convert to Latin alphabet
>>> roma_sentence = yakinori.get_roma_sentence(parsed_list, is_hatsuon=True)
>>> print(roma_sentence)
yuーyuーhakushowasaikoーnomangadesu
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/morikatron/yakinori",
    "name": "yakinori",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "Japanese converter,Japanese,text preprocessing,Hiragana,Katakana,Kanji,alphabet",
    "author": "Hikaru Yamada",
    "author_email": "hikaru.yamada@morikatron.co.jp",
    "download_url": "",
    "platform": null,
    "description": "# yakinori\nJapanese REAMED is here.  \nhttps://github.com/morikatron/yakinori/blob/main/README_ja.md\n\nJapanese Converter Kanji to Hiragana, Katakana, Latin alphabet.  \n\nYou can get the reading and pronunciation of Japanese sentences based on mecab-unidic-NEologd.  \n\n## Test Environments\n```\nUbuntu18.04\npython==3.8.16\n```\n\n## Install\nThere are two options to install.\n- Install Mecab and mecab-unidic-NEologd in your own environment  \n- Use Docker\n\n\n### Your Own Environment\n#### For Ubuntu\n##### Install Mecab\n```bash\n$ sudo apt update\n$ sudo apt install mecab libmecab-dev mecab-ipadic-utf8\n```\n\n##### Install mecab-unidic-NEologd\n```bash\n$ git clone --depth 1 https://github.com/neologd/mecab-unidic-neologd.git\n$ cd mecab-unidic-neologd\n$ sudo ./bin/install-mecab-unidic-neologd -n -y\n\n# show installed mecab-unidic-NEologd dictionary path\n$ echo `mecab-config --dicdir`\"/mecab-unidic-neologd\"\n> /usr/local/lib/mecab/dic/mecab-unidic-neologd\n\n# If you want to make mecab-unidic-NEologd as defalut dictionary, run commands below.\n$ echo \"dicdir = `mecab-config --dicdir`/mecab-unidic-neologd\" | sudo tee /etc/mecabrc\n$ sudo cp /etc/mecabrc /usr/local/etc\n\n```\n\n##### Install yakinori\n```bash\n$ pip install yakinori\n```\n\n##### You can update the recent mecab-unidic-NEologd\n```bash\n$ sudo ./bin/install-mecab-unidic-neologd -n -y\n$ echo \"dicdir = `mecab-config --dicdir`/mecab-unidic-neologd\" | sudo tee /etc/mecabrc\n$ sudo cp /etc/mecabrc /usr/local/etc\n```\n\n#### Use Docker\n```bash\n$ docker pull morikayamada/yakinori\n```\n\n## How to use\n### Import\n```python\n>>> from yakinori import Yakinori\n```\n\n### create Instance\n#### Installed on your Own Environment\n- If you made mecab-unidic-NEologd as defalut dictionary, you don't need to add dic_path.  \n```python\n>>> yakinori = Yakinori()\n```\n- If you did not make mecab-unidic-NEologd as defalut dictionary, add dic_path.  \n```python\n>>> yakinori = Yakinori(dic_path='path/to/mecab-unidic-NEologd') \n```\n#### Using Docker\nIf you use Docker, you don't need to add dic_path.  \n```python\n>>> yakinori = Yakinori()\n```\n\n### Parse Sentence\n```python\n>>> sentence = \"\u5e7d\u2606\u904a\u2606\u767d\u66f8\u306f\u6700\u9ad8\u306e\u6f2b\u753b\u3067\u3059\"\n>>> parsed_list = yakinori.get_parsed_list(sentence)\n```\n\n### Get Reading\n```python\n# convert to hiragana\n>>> hiragana_sentence = yakinori.get_hiragana_sentence(parsed_list)\n>>> print(hiragana_sentence)\n\u3086\u3046\u3086\u3046\u306f\u304f\u3057\u3087\u306f\u3055\u3044\u3053\u3046\u306e\u307e\u3093\u304c\u3067\u3059\n\n# convert to katakana\n>>> katakana_sentence = yakinori.get_katakana_sentence(parsed_list)\n>>> print(katakana_sentence)\n\u30e6\u30a6\u30e6\u30a6\u30cf\u30af\u30b7\u30e7\u30cf\u30b5\u30a4\u30b3\u30a6\u30ce\u30de\u30f3\u30ac\u30c7\u30b9\n\n# convert to Latin alphabet\n>>> roma_sentence = yakinori.get_roma_sentence(parsed_list)\n>>> print(roma_sentence)\nyuuyuuhakushohasaikounomangadesu\n```\n\n### Get Pronunciation\n```python\n# convert to hiragana\n>>> hiragana_sentence = yakinori.get_hiragana_sentence(parsed_list, is_hatsuon=True)\n>>> print(hiragana_sentence)\n\u3086\u30fc\u3086\u30fc\u306f\u304f\u3057\u3087\u308f\u3055\u3044\u3053\u30fc\u306e\u307e\u3093\u304c\u3067\u3059\n\n# convert to katakana\n>>> katakana_sentence = yakinori.get_katakana_sentence(parsed_list, is_hatsuon=True)\n>>> print(katakana_sentence)\n\u30e6\u30fc\u30e6\u30fc\u30cf\u30af\u30b7\u30e7\u30ef\u30b5\u30a4\u30b3\u30fc\u30ce\u30de\u30f3\u30ac\u30c7\u30b9\n\n# convert to Latin alphabet\n>>> roma_sentence = yakinori.get_roma_sentence(parsed_list, is_hatsuon=True)\n>>> print(roma_sentence)\nyu\uff70yu\uff70hakushowasaiko\uff70nomangadesu\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "yakinori is a tool for converting Kanji to hiragana, katakana, roma-ji.",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/morikatron/yakinori"
    },
    "split_keywords": [
        "japanese converter",
        "japanese",
        "text preprocessing",
        "hiragana",
        "katakana",
        "kanji",
        "alphabet"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0c64d7a3ae2d99741c0fda6605f4897ab2806065114b35635bc63bcdafe76b67",
                "md5": "4911a820040356100a45fbb0cbaaf523",
                "sha256": "10884588ed78d3a8ec073d61680dde6a21837a446a71049916b62fb206d9b269"
            },
            "downloads": -1,
            "filename": "yakinori-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4911a820040356100a45fbb0cbaaf523",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5233,
            "upload_time": "2023-06-17T05:21:48",
            "upload_time_iso_8601": "2023-06-17T05:21:48.072849Z",
            "url": "https://files.pythonhosted.org/packages/0c/64/d7a3ae2d99741c0fda6605f4897ab2806065114b35635bc63bcdafe76b67/yakinori-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-17 05:21:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "morikatron",
    "github_project": "yakinori",
    "github_not_found": true,
    "lcname": "yakinori"
}
        
Elapsed time: 1.53220s