Let's use python janome easily

What is the python janome library?

The morphological analyzer included in the dictionary decomposes Japanese!

janome official documentation

https://mocobeta.github.io/janome/

Let's use it easily

environment

$ python3 -V
Python 3.7.3

Virtual environment construction

$ mkdir janome-sample    
$ cd janome-sample 
$ python3 -m venv venv
$ source ./venv/bin/activate

wordcloud installation

$ pip install janome

Run janome


$ python3
Python 3.7.3 (default, Mar  6 2020, 22:34:30) 
[Clang 11.0.3 (clang-1103.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> from janome.tokenizer import Tokenizer
>>> t = Tokenizer()
>>> for token in t.tokenize(u'At the end of the song, Gauche rushed into the dressing room with a cello as quickly as the cat, without looking at everyone anymore.'):
...   print(token)
... 
Song noun,General,*,*,*,*,Song,Kyoku,Kyoku
Is a particle,Case particles,General,*,*,*,But,Moth,Moth
Ending verb,Independence,*,*,Five steps, La line,Uninflected word,end,Owar,Owar
And particles,Connection particle,*,*,*,*,When,To,To
Gauche noun,General,*,*,*,*,Gauche,*,*
Is a particle,Particle,*,*,*,*,Is,C,Wow
Another adverb,General,*,*,*,*,Already,Mou,Mo
Everyone noun,Pronoun,General,*,*,*,Everyone,Minna,Minna
Particles,Attributive,*,*,*,*,of,No,No
Noun,Non-independent,General,*,*,*,One,Hou,Ho
Etc. Particles,Particles,*,*,*,*,Such,Nad,Nad
Is a particle,Particle,*,*,*,*,Is,C,Wow
Verb,Independence,*,*,One step,Continuous form,to see,Mi,Mi
Also particles,Particle,*,*,*,*,Also,Mo,Mo
Verb,Independence,*,*,Sahen Suru,Nu connection,To do,Se,Se
Auxiliary verb,*,*,*,Special,Continuous connection,Nu,Zu,Zu
Just an adverb,General,*,*,*,*,Just,Choudo,Chode
That adnominal adjective,*,*,*,*,*,That,Sono,Sono
Cat noun,General,*,*,*,*,Cat,cat,cat
Particles,Attributive,*,*,*,*,of,No,No
Noun,Non-independent,Auxiliary verb stem,*,*,*,Yo,You,Yaw
Particles,Adverbization,*,*,*,*,To,D,D
Quick adjectives,Independence,*,*,Adjective, Auoudan,Continuous connection,Quick,Subayak,Subayak
Cyril noun,General,*,*,*,*,Cyril,Cyril,Cyril
Particles,Case particles,General,*,*,*,To,Wo,Wo
Motto verb,Independence,*,*,Five steps / Ta line,Continuous connection,Offal,Mot,Mot
Particles,Connection particle,*,*,*,*,hand,Te,Te
Dressing room noun,General,*,*,*,*,dressing room,Gakuya,Gakuya
To particle,Case particles,General,*,*,*,What,F,D
Noun,General,*,*,*,*,Liao,*,*
Ge noun,suffix,General,*,*,*,Ge,Ge,Ge
Including verb,Independence,*,*,Five steps, Ma line,Continuous form,Get in,Komi,Komi
Auxiliary verb,*,*,*,Special / mass,Continuous form,Masu,Mashi,Mashi
Auxiliary verb,*,*,*,Special,Uninflected word,Ta,Ta,Ta
>>> 

It was good

Recommended Posts

Let's use python janome easily
Let's use def in python
Let's use python's wordcloud easily!
[Introduction to Python] Let's use pandas
[Introduction to Python] Let's use pandas
[Introduction to Python] Let's use pandas
Easily use your own functions in Python
Let's use pytube
[Introduction to Python] Let's use foreach with Python
Let's use different versions of SQLite3 from Python3!
Use thingsspeak from python
Use config.ini in Python
[Python] Use JSON with Python
Use fluentd from python
Use dates in Python
Use Valgrind in Python
Use MySQL from Python
Use mecab with Python3
Use LiquidTap Python Client ③
Use DynamoDB with Python
Use Python 3.8 with Anaconda
[Python] format methodical use
Use python with docker
Use MySQL from Python
Easily beep with python
Use LiquidTap Python Client ②
Use BigQuery from python.
Use profiler in Python
Use mecab-ipadic-neologd from python
Use LiquidTap Python Client ①
Let's use the Python version of the Confluence API module.
Let's start Python from Excel. I don't use VBA.
Let's use the open data of "Mamebus" in Python
Use Trello API with python
Easily format JSON in Python
Easily serverless with Python with chalice
Use matplotlib on Ubuntu 12 & Python
Use let expression in Python
Use Measurement Protocol in Python
python3: How to use bottle (2)
Use callback function in Python
I can't move to Python3 easily, so let's consider compatibility 2-3
Let's run Excel with Python
Use Twitter API with Python
Use parameter store in Python
[Python] Use a string sequence
[Python] How to use list 1
Python is painful. But use
Use HTTP cache in Python
Use TUN / TAP with Python
Use MySQL from Anaconda (python)
Use MongoDB ODM in Python
Use list-keyed dict in Python
How to use Python argparse
Use Random Forest in Python
Use regular expressions in Python
Use Spyder in Python IDE
Japanese NLP @ janome / spaCy / Python
Python: How to use pydub
[Python] How to use checkio
Let's use MemSQL Vol.14: Practice 7