Metadata-Version: 2.1
Name: JPFreq
Version: 0.1.0
Summary: A Python module which allows for the easy frequency analysis of Japanese text
Project-URL: Homepage, https://github.com/Marley-Mulvin-Broome/JapaneseFrequencyProcessor
Project-URL: Source, https://github.com/Marley-Mulvin-Broome/JapaneseFrequencyProcessor
Project-URL: Documentation, https://marley-mulvin-broome.github.io/JapaneseFrequencyProcessor
Author-email: Marley Mulvin Broome <marley.developer@gmail.com>
Maintainer-email: Marley Mulvin Broome <marley.developer@gmail.com>
License: MIT License
        
        Copyright (c) 2023 Marley Mulvin Broome
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: Anime,Frequency,Japanese,Japanese Learning,Japanese Study,Language Learning,Manga,Tool
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: Japanese
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.10
Requires-Dist: fugashi
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: build; extra == 'dev'
Requires-Dist: fugashi[unidic]; extra == 'dev'
Requires-Dist: pdoc3; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest-xdist; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Description-Content-Type: text/markdown

# JPFreq

![Tests](https://github.com/Marley-Mulvin-Broome/JapaneseFrequencyProcessor/actions/workflows/test.yaml/badge.svg)
![Docs](https://github.com/Marley-Mulvin-Broome/JapaneseFrequencyProcessor/actions/workflows/docs.yaml/badge.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Code Style: Black](https://camo.githubusercontent.com/d91ed7ac7abbd5a6102cbe988dd8e9ac21bde0a73d97be7603b891ad08ce3479/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d626c61636b2d3030303030302e737667)
![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)


<!-- TOC -->
* [JPFreq](#jpfreq)
  * [Installation](#installation)
  * [Usage](#usage)
    * [Getting the most frequent words](#getting-the-most-frequent-words)
    * [Reading from a file](#reading-from-a-file)
<!-- TOC -->

JPFreq is a frequency processor for Japanese text. It uses the Cython wrapper for MeCab [Fugashi](https://github.com/polm/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](https://marley-mulvin-broome.github.io/JapaneseFrequencyProcessor/).

### Getting the most frequent words

```python
from jpfreq.jp_frequency_list import JapaneseFrequencyList

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

print(freq_list.get_most_frequent())
```

### Reading from a file

```python
from jpfreq.jp_frequency_list import JapaneseFrequencyList

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

print(freq_list.get_most_frequent())
```
