Changelog¶
Released and unreleased changes. The text below is CHANGELOG.md from the repository. The newest section is Unreleased.
Unreleased¶
roman.type_odiatypes Roman Odia into Odia script offline (namaskaragivesନମସ୍କାର). Whitespace and punctuation stay put.candidates=Truereturns up to eight full strings, best first, ranked by how often each glossary word occurs. Letters with no Hunterian spelling (c,f,q,x,z) are read as Odia consonants, and a glossary token that is not a well-formed syllable is not offered. This is typing, separate fromopenodia.phoneticmatching.roman.type_odianeeds a release newer than 0.2.0: it raisesAttributeErroron 0.2.0.- Add
openodia.spell(is_correct,suggest,correct_text) andopenodia spellto check an Odia word, suggest dictionary corrections, and correct text in place. Suggestions use akshara edit distance up to 2 against the offline dictionary, ranked by akshara distance, then, at the same akshara distance, by letter distance weighed against how often the word appears there (each letter closer counts as much as appearing about 3.8 times as often), sospell.suggest,spell.correct_textandopenodia spelloutput pickବିଚ୍ଛେଦforବୀଚ୍ଛେଦandସ୍ୱିଗଲିଙ୍ଗ୍forଶ୍ୱିଗଲିଙ୍ଗ୍;spell.is_correctandopenodia spell --checkare unchanged by this ranking. Whitespace, punctuation, digits and non-Odia text stay as written, and a word with no candidate within distance 2 is left as written. It needs a release newer than 0.2.0:openodia spellexits 2 on 0.2.0, andimport openodia.spellfails on 0.2.0. pii.detectandpii.mask: Text that is not in NFC is also searched in its NFC form, and each match is mapped back to offsets in the text you passed, so a PAN followed by a decomposed accented letter is found. In text that is not in NFC, a match found in the NFC form whose last letter carries 32 or more combining marks also covers those marks.- Add
openodia.legacywithdecodeandto_unicode.legacy.decodereads the bytes of text typed in an 8-bit Odia font as keystroke characters: cp1252 for each defined byte, while 0x81, 0x8D, 0x8F, 0x90 and 0x9D, which that codec leaves undefined, stay as those code points.legacy.to_unicode(text, font="ORTTSarala")converts those keystrokes to NFC Unicode Odia, so ଡ଼ is consonant plus nukta.SUPPORTED_FONTSis("ORTTSarala",). After the glyph table,to_unicoderebuilds each syllable in Unicode order: reph, base consonant, subjoined forms in the order typed, vowel sign, then nasal or visarga. A reph, vowel sign, nasal or visarga typed before a subjoined form gives the same output as typed after it (ÒLÕÔÍandÒLÔÍÕboth giveକ୍ୟ୍ରେଂ). A reph typed in a syllable with no base consonant stays where it was typed. The left matraÒ, typed before the consonant, joins its right halfß,×orÐinto ୈ, ୌ or ୋ wherever that half is typed in the syllable (ÒLàÔßandÒLÔßàboth giveର୍କ୍ୟୈ). Only the first right half joins it, and a later one stays as typed (ÒLÐßgivesକୋß). A secondÒin the same syllable gives େ after the joined sign (ÒLÒÐgivesକୋେ). A second reph in the same syllable is dropped (Lààgivesର୍କ). Nasals and visarga keep the order typed (LÓÕgivesକଃଂ). A nukta,Ïor a Unicode଼, goes right after the consonant typed last before it in the same syllable, ahead of any halant or zero-width joiner, also when a vowel sign, nasal, visarga or reph is typed in between (XÐÏandXÏÐboth giveଡ଼ା). In a syllable with no consonant, a nukta goes ahead of the vowel signs.útyped after କ, ସ or ପ puts a half ta before that consonant (DLúfgivesଉତ୍କଳ). A run of numeric separators all convert (1Ð2Ð3gives୧|୨|୩). The ORTTSarala glyph table and theúhalf-ta rule come from the OdiaWikimedia ORTT-Sarala converter, https://github.com/OdiaWikimedia/Converter.openodia.legacyneeds a release newer than 0.2.0:import openodia.legacyfails on 0.2.0. piifinds calendar dates asDATE: a day, an English or Odia month name and a year (15 January 2024,May 4, 2024,୧୫ ଜାନୁଆରୀ ୨୦୨୪) at confidence 0.85, or day-month-year digits with/,-or.(15/01/2024) at 0.7. Only real days from 1900 to 2099 are found.DATEneeds a release newer than 0.2.0: on 0.2.0,pii.detect(text, types=["DATE"])raisesValueErrorandopenodia pii --type DATEexits 2.
0.2.0 (2026-11-13)¶
Added¶
- Add
openodia.sandhito split an Odia compound into the words sandhi joined (split) and to join those parts (join). A known lemma, or a word that does not split into two known words, is returned unchanged.splitandjoinNFC-normalize, so for a compound the splitter acceptsjoin(split(word))equals the NFC form of that word: https://github.com/soumendrak/openodia/pull/299 - Add
openodia.piiandopenodia piito find or mask phone numbers, emails, URLs, Aadhaar (Verhoeff checksum), PAN and PIN codes in Odia or ASCII digits. Overlapping matches merge into one span, so for every detected valuemasknever leaves part of it visible (see the limits below), andmaskrepeats until stable so masking its output changes nothing (up to 10 glued values). Detection is linear in the input size: https://github.com/soumendrak/openodia/pull/281 - Every CLI subcommand accepts
--jsonand prints one UTF-8 JSON document on stdout; default text output is unchanged by--json. With--json, invalid UTF-8 in stdin or in the text argument is anopenodia: error:with exit code 1;detect-language --jsonused to pass it through in 0.1.14: https://github.com/soumendrak/openodia/pull/278 and https://github.com/soumendrak/openodia/pull/279 - Async translation:
odia_to_other_lang_async,other_lang_to_odia_async,universal_translation_asyncandtranslate_batchwith bounded concurrency, optional retries andreturn_exceptions: https://github.com/soumendrak/openodia/pull/284 openodia.phonetic: Odia-adapted phonetic matching (soundex,metaphone, andsimilarity): https://github.com/soumendrak/openodia/pull/226openodia.indic: transliterate between Brahmic Indic scripts. A composition-excluded nukta letter is consonant + nukta when the target has those parts, except Gurmukhi flap RRA and a target LLA, SHA, or YYA, which stay one letter. Odia WA stays when the target has no WA. Bengali writes VA as BA. A Malayalam chillu expands to consonant + virama: https://github.com/soumendrak/openodia/pull/228openodia.roman: Odia romanisation (to_roman/from_roman) with the ISO 15919, Hunterian and ITRANS schemes.to_romanwrites a nukta after any consonant except ଡ and ଢ as·in ISO 15919 and a backtick in ITRANS, and drops it in Hunterian. ଡ଼ and ଢ଼ keep their own letters in all three schemes:ṛ/ṛhin ISO 15919,.D/.Dhin ITRANS, andr/rhin Hunterian (where plain ଡ and ଢ gived/dh).from_romanreads each scheme's mark back as the nukta, soto_roman(..., reversible=True)now quotes a literal·(ISO 15919) or backtick (ITRANS) instead of passing it through. By default,to_romanreturns non-Odia text exactly as given, so its output no longer round-trips text that mixes Odia with other text (for exampleto_roman("କi")giveskai, whichfrom_romanreads asକୈ). Callers who need an exact round trip should passreversible=True(to_roman("କi", reversible=True)giveska:{i:}). InISO15919andITRANS,from_roman(to_roman(text, scheme, reversible=True), scheme)gives backtextwith each run of Odia characters (U+0B00-U+0B7F) in NFC and all other characters unchanged. NFC Odia therefore comes back with the same code points, including vowel signs, viramas and nuktas that follow no consonant or follow ZWJ/ZWNJ. In all three schemes, each run of Odia characters (U+0B00-U+0B7F) in the output offrom_romanis in NFC, including Odia passed through or quoted in the input, so U+0B5C gives U+0B21 U+0B3C. Non-Odia characters thatfrom_romandoes not decode are left as given, except thatISO15919applies NFC to its input outside quotes: https://github.com/soumendrak/openodia/pull/227- The package ships
py.typed(PEP 561) and is fully type-annotated (mypy strict), so type checkers see the narrowedremove_stopwordsreturn types: https://github.com/soumendrak/openodia/pull/280 and https://github.com/soumendrak/openodia/pull/283 - Docs for AI agents (
AGENTS.md,skills/openodia/SKILL.mdandllms.txt), a generated API reference and six usage guides (text, script and names, numbers, analysis, translation, command line) with every guide example checked by the test suite, a getting started page, guides for transliteration and PII, API pages forpii,indic, async translation, andSTOPWORDS, plus a changelog page and a contributing page. Docs search suggests matches and highlights the terms. Getting started says।is its own token only when a space precedes it. Thedocsanddevextras now includemkdocstrings[python]; the library's runtime dependencies are unchanged: https://github.com/soumendrak/openodia/pull/278, https://github.com/soumendrak/openodia/pull/289 and https://github.com/soumendrak/openodia/pull/297
Changed¶
- Behaviour change, changes default output:
ud.sentence_tokenizernow splits after।,॥,?and!, with or without a space after them; it used to split only on" ।". Each sentence is trimmed and keeps its terminator, a terminator with no words of its own joins its neighbour, and empty input gives[]. A?or!directly followed by an ASCII letter, digit or=&%#/_(a?id=5,Yahoo!Mail) is not a boundary.["ଏକ ଦୁଇ", " ତିନି ଚାରି", ""]becomes["ଏକ ଦୁଇ ।", "ତିନି ଚାରି ।"]. This changes the default text and--jsonoutput ofopenodia tokenize --sentences(no leading spaces, no empty last entry,[]for empty input; text mode prints no blank line for empty input) and ofopenodia summarizeandWordFrequency.get_summary(sentences keep their।and are joined with one space, and text containing?,!,॥or a danda without a leading space is split into different sentences, so the chosen sentences can differ). This overrides the "output is unchanged" statement in the--jsonbullet above for these two subcommands: https://github.com/soumendrak/openodia/pull/293 TranslationCachecan be shared between threads (it can still be pickled and deep-copied). Concurrentget,setandclearcalls no longer raiseKeyErroror lose hit and miss counts, and agetthat reads the disk cache while asetorclearruns no longer puts the old or cleared value back in memory. A disk write or clear that raises leaves the cache usable. Pickling or copying a cache while another thread writes to it takes a consistent snapshot. Behaviour change:copy.copy(cache)now gets its own memory entries instead of sharing them with the original.openodia.cache.get_cache()builds its singleton under a lock, so threads making the first call together share one cache (before,OPENODIA_CACHE_DISKcould give each its own, losing entries and counts): https://github.com/soumendrak/openodia/pull/296import openodiaandopenodia --helpno longer importfaker,deep_translator,requestsorbs4; they load on first use ofname.generate_namesor a Google translation (a cached result or an offline-dictionary hit loads nothing).import openodiais about 2.5x faster in this repo's measurements. The public API is unchanged: https://github.com/soumendrak/openodia/pull/292import openodiano longer configures logging. It used to calllogging.basicConfigwith a Rich handler, which attached a root handler in the host application and printed log lines (with local variables in tracebacks) to stdout. Library logs now go to theopenodialogger, which has aNullHandler; configure logging in your application to see them. TheopenodiaCLI output is unchanged: https://github.com/soumendrak/openodia/pull/290
Fixed¶
openodia translateandother_lang_to_odiafind offline-dictionary words when the text has leading or trailing whitespace. Input from--fileor stdin ends in a newline, so it used to miss the dictionary and call Google Translate, which failed whenever Google rate limited the request: https://github.com/soumendrak/openodia/pull/294- An invalid
name_typeinname.generate_firstnameslogs an error without the meaninglessNoneType: Nonetraceback line (theValueErroris unchanged): https://github.com/soumendrak/openodia/pull/290
Known limits¶
- Sandhi: the splitter knows 74 lemmas.
splitreturns at most two known lemmas, so it does not unpack a longer compound (for examplejoin(["ଲୋକ", "ସଭା", "ଗୃହ"])isଲୋକସଭାଗୃହ, andsplitof that string does not return three parts).splittakes one word; a spaced phrase such asବିଦ୍ୟା ଆଳୟis returned unchanged.joincan still fold more than two parts. - Hunterian is intentionally lossy (no diacritics) and ignores
reversible. It drops vowel length, soto_roman("ନମସ୍କାର", "Hunterian")isnamaskaraandfrom_romanof that spelling isନମସ୍କର, notନମସ୍କାର. Odia digits become ASCII0-9even whenreversible=True. Hunterianfrom_romandecodes no Roman spelling as anusvara, candrabindu or visarga: annorhthat is not part of a longer letter such asngorkhdecodes as the consonantନorହ. Odiaଂ,ଁandଃin the input pass through.ନ୍endings and clusters such asନ୍ସandଙ୍କdo round-trip; anusvara and visarga round-trip through the explicit marks of ISO 15919 and ITRANS. piidoes not detect names, addresses, dates or amounts, so masked text can still identify a person.- English to Odia is served from the bundled offline dictionary when the phrase is in it; every other translation pair calls Google Translate over the network, which can be rate limited and refuses text of 5,000 or more characters.
0.1.14 (2026-10-26)¶
python -m openodianow runs the CLI.- Add CLI
--version, UTF-8 stdin handling, and concise file/encoding errors. - File input now requires
--file; existing filenames passed without it are literal text. openodia translatereports Google rate limits, unsupported language codes and text over 5,000 characters as a singleopenodia: error:line instead of a traceback.- UTF-8 byte order marks are ignored in
--fileinput, stdin andStopwords.from_file, which now defaults toencoding="utf-8-sig"(files without a BOM read as before). - The CLI exits quietly on a closed pipe (status 141), reports closed stdin and invalid
OPENODIA_CACHE_*values as one-line errors, and names argument types plainly in error messages. - Docs:
alphabet.matras, two-decimal confidence scores and a workingud.sentence_tokenizerexample.