Skip to main content

A Python module which allows for the easy frequency analysis of Japanese text

Project description

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
    pip install fugashi[unidic]
    python3 -m unidic download
    
  2. Install JPFreq
    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())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jpfreq-0.2.2.tar.gz (32.3 kB view hashes)

Uploaded Source

Built Distribution

jpfreq-0.2.2-py3-none-any.whl (14.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page