Skip to main content

pynooj

Python library for parsing NooJ's dictionary files.

Overview

pynooj is a Python library that parses NooJ dictionary files (.dic) and extracts lexical information including inflected forms, lemmas, grammatical categories, and morphological traits.

For more information about NooJ, visit the NooJ website.

Installation

pip install pynooj

Usage

Basic Example

from pynooj import read_dic

# Parse a NooJ dictionary file
entries = read_dic("path/to/dictionary.dic")

# Each entry is a dictionary containing:
# - "inflected form": the word form
# - "lemma": the base form (optional)
# - "category": grammatical category (e.g., "V", "N", "A")
# - "traits": morphological attributes

for entry in entries:
    print(entry["inflected form"], "→", entry["lemma"])
    print(f"  Category: {entry['category']}")
    print(f"  Traits: {entry['traits']}")

Dictionary File Format

NooJ dictionary files use a comma-separated format:

inflected_form,lemma,category+Trait1=Value1+Trait2=Value2

Examples:

amo,amare,V+Theme=INF+FLX=GP1_INF+GP=1
casa,casa,N+Number=SG+Gender=F

API Reference

read_dic(path)

Parses a NooJ dictionary file and returns a list of lexical entries.

Parameters:

  • path (str): Path to the .dic file

Returns:

  • List of dictionaries, each containing:
    • "inflected form": the word form (string)
    • "lemma": the base form (string, optional)
    • "category": grammatical category (string)
    • "traits": dictionary of morphological traits (dict)

Running Tests

To run the test suite with unittest:

python -m unittest discover -s tests

Publishing to PyPI

Prerequisites

Ensure you have the necessary tools installed:

pip install build twine

Steps

  1. Update version in pyproject.toml

  2. Build the package:

    python -m build
    
  3. Upload to PyPI:

    twine upload dist/*
    
  4. Upload to TestPyPI (optional, for testing):

    twine upload --repository testpypi dist/*
    

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

License

See the LICENSE file for details.

Related Resources

Metadata

Release files for pynooj 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pynooj 0.1.4
File Size Uploaded
pynooj-0.1.4.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pynooj 0.1.4
File Interpreter ABI Platform
pynooj-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 7.0 kB

Release files / pynooj-0.1.4.tar.gz

Download URL pynooj-0.1.4.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8b4d91813b8f7e5530d94a5658327bb49e7f30dc28d7a1959b586168817fd76c
BLAKE2b-256 checksum
How to use checksums
4c47ec395c9bf57cb0f7982a00b5453e51d173db164b3e7d39d18aed82337e7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / pynooj-0.1.4-py3-none-any.whl

Download URL pynooj-0.1.4-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
190ff3c40b5e4dadf5c1db9db6084e18a21d0d7fc42e39148da313f9225be62c
BLAKE2b-256 checksum
How to use checksums
288b66c14c47d3f760739b4c6eace87e58548a829324700b4bb143acb73fea94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page