Package jpfreq

JPFreq

Tests Docs License: MIT Code Style: Black Ruff

JPFreq is a frequency processor for Japanese text. It uses the Cython wrapper for MeCab Fugashi to process Japanese text.

Installation

  1. Install Fugashi and Unidic bash pip install fugashi[unidic] python3 -m unidic download
  2. Install JPFreq bash pip install jpfreq

Usage

For detailed usage, see the documentation.

Getting the most frequent words

from jpfreq.jp_frequency_list import JapaneseFrequencyList

freq_list = JapaneseFrequencyList()
freq_list.process_line("私は猫です。")

print(freq_list.get_most_frequent())

Reading from a file

from jpfreq.jp_frequency_list import JapaneseFrequencyList

freq_list = JapaneseFrequencyList()
freq_list.process_file("path/to/file.txt")

print(freq_list.get_most_frequent())
Expand source code
"""
.. include:: ../../README.md
"""

Sub-modules

jpfreq.exporters
jpfreq.jp_frequency_list

Japanese Frequency List …

jpfreq.kanji

Kanji

jpfreq.main

Main, CLI tool for testing JPFreq

jpfreq.text_info

TextInfo

jpfreq.util

Utility

jpfreq.word

Word

jpfreq.word_slot

Word Slot