Skip to main content

Grapheme Parser for indic languages

Project description

indicparser

Grapheme Parser for indic languages

Installaton

pip install indicparser

Useage

  • initializing the parser
from indicparser import graphemeParser
gp=graphemeParser("bangla")
  • extracting graphemes
text="  শাটিকাপ   মার"
graphemes=gp.process(text)
print("Graphemes:",graphemes)

Graphemes: [' ', ' ', 'শা', 'টি', 'কা', 'প', ' ', ' ', ' ', 'মা', 'র']

  • extracting graphemes but merging spaces and clearing initial and ending space
graphemes=gp.process(text,merge_spaces=True)
print("Graphemes (space corrected):",graphemes)

Graphemes (space corrected): ['শা', 'টি', 'কা', 'প', ' ', 'মা', 'র']

  • treatment of numbers and puntucation and english is also available by default
text="এটাকি 2441139 ? না ভাই wrong number"
graphemes=gp.process(text,merge_spaces=True)
print("Graphemes:",graphemes)

Graphemes: ['এ', 'টা', 'কি', ' ', '2', '4', '4', '1', '1', '3', '9', ' ', '?', ' ', 'না', ' ', 'ভা', 'ই', ' ', 'w', 'r', 'o', 'n', 'g', ' ', 'n', 'u', 'm', 'b', 'e', 'r']

  • available languages
from indicparser import languages
languages.keys()

dict_keys(['bangla', 'malyalam', 'tamil', 'gujrati', 'panjabi', 'odiya', 'hindi','nagri'])

Normalization

  • For best results use normalized text before parsing
  • An example bangla unicode normalizer can be found here

ABOUT

@inproceedings{ansary-etal-2024-unicode-normalization,
    title = "{U}nicode Normalization and Grapheme Parsing of {I}ndic Languages",
    author = "Ansary, Nazmuddoha  and
      Adib, Quazi Adibur Rahman  and
      Reasat, Tahsin  and
      Sushmit, Asif Shahriyar  and
      Humayun, Ahmed Imtiaz  and
      Mehnaz, Sazia  and
      Fatema, Kanij  and
      Rashid, Mohammad Mamun Or  and
      Sadeque, Farig",
    editor = "Calzolari, Nicoletta  and
      Kan, Min-Yen  and
      Hoste, Veronique  and
      Lenci, Alessandro  and
      Sakti, Sakriani  and
      Xue, Nianwen",
    booktitle = "Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)",
    month = may,
    year = "2024",
    address = "Torino, Italia",
    publisher = "ELRA and ICCL",
    url = "https://aclanthology.org/2024.lrec-main.1479",
    pages = "17019--17030",
    abstract = "Writing systems of Indic languages have orthographic syllables, also known as complex graphemes, as unique horizontal units. A prominent feature of these languages is these complex grapheme units that comprise consonants/consonant conjuncts, vowel diacritics, and consonant diacritics, which, together make a unique Language. Unicode-based writing schemes of these languages often disregard this feature of these languages and encode words as linear sequences of Unicode characters using an intricate scheme of connector characters and font interpreters. Due to this way of using a few dozen Unicode glyphs to write thousands of different unique glyphs (complex graphemes), there are serious ambiguities that lead to malformed words. In this paper, we are proposing two libraries: i) a normalizer for normalizing inconsistencies caused by a Unicode-based encoding scheme for Indic languages and ii) a grapheme parser for Abugida text. It deconstructs words into visually distinct orthographic syllables or complex graphemes and their constituents. Our proposed normalizer is a more efficient and effective tool than the previously used IndicNLP normalizer. Moreover, our parser and normalizer are also suitable tools for general Abugida text processing as they performed well in our robust word-based and NLP experiments. We report the pipeline for the scripts of 7 languages in this work and develop the framework for the integration of more scripts.",
}

Change Log

0.0.1 (12/02/2022)

  • First Release

0.0.2 (12/02/2022)

  • Basic Documentation
  • Modifier removal
  • space correction
  • text mode parser

0.0.3 (14/02/2022)

  • Connector ending
  • Exception case for component construction in bangla
  • Added test

0.0.4 (14/02/2022)

  • pip test stable
  • added malformed word detection

0.0.5 (19/02/2022)

  • encoding correction
  • no space char handling

0.0.6 (15/04/2022)

  • removed malformed word detection [not useful]
  • removed component calculation [not consistent]

0.0.7 (26/04/2022)

  • addition order correction

0.0.8 (21/10/2022)

  • allow middle Connector

0.0.9 (31/12/2022)

  • added sylheti nagri

0.0.10 (31/12/2022)

  • added sylheti nagri alternate hosonto

0.1.0 (26/05/2024)

  • added proper citation

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

indicparser-0.1.0.tar.gz (432.1 kB view details)

Uploaded Source

Built Distribution

indicparser-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file indicparser-0.1.0.tar.gz.

File metadata

  • Download URL: indicparser-0.1.0.tar.gz
  • Upload date:
  • Size: 432.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for indicparser-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f66e4bd38fcb511e0fbc2d0b78237527faea9f358925a56dad4d4b2bff08d0c
MD5 fbfba10b560b226676f651fa335752c0
BLAKE2b-256 6225a2da000406fdae162f1811e73236a56ed2f5e8f25a2d95a2892ecb4c6e2b

See more details on using hashes here.

File details

Details for the file indicparser-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: indicparser-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for indicparser-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32ba30a2594f8a52cf96f38c8375084e4c2fb961f76d6379e39ae7150c486f4c
MD5 fcf39509b6e6c07a1cd4d56a24cf97fb
BLAKE2b-256 940c8ea9d88eb89ff4375600ac0d1a272d644fa68f9ae58c440d92580c9b5194

See more details on using hashes here.

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