Skip to content

Add ISCII and legacy-font Devanagari conversion#1763

Open
maziyarpanahi wants to merge 1 commit into
masterfrom
feature/om-660-indic-iscii-legacy-font-unicode-conversion
Open

Add ISCII and legacy-font Devanagari conversion#1763
maziyarpanahi wants to merge 1 commit into
masterfrom
feature/om-660-indic-iscii-legacy-font-unicode-conversion

Conversation

@maziyarpanahi

Copy link
Copy Markdown
Owner

Description

Adds deterministic, local ISCII-1991 and caller-supplied legacy-font conversion before Indic normalization and PII routing. The conversion preserves source-byte alignment so spans detected on Unicode text can be reported against the original legacy stream, while conservative heuristics leave ordinary Latin and valid UTF-8 input unchanged.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition/improvement

Changes Made

  • Add bidirectional ISCII-1991 Devanagari conversion with contextual nukta, virama, join-control, extension, NFC, and byte-offset handling.
  • Add conservative ISCII and suspicious ASCII-cluster detection plus immutable JSON/YAML legacy-font maps without bundled proprietary font data.
  • Integrate conversion into detection and pipeline normalization, preserve attached Indic marks, and expose PHI-safe conversion metadata.
  • Document usage, provenance, licensing, offset mapping, and the Vedic/INV limitations.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this change with different models/inputs

Validation:

  • .venv/bin/python -m pytest tests/ -q — 5215 passed, 46 skipped
  • make format
  • make lint
  • make format-check
  • make type-check
  • make docs-build

Documentation

  • I have updated the documentation accordingly
  • I have added docstrings to new functions/classes
  • I have updated the CHANGELOG.md

Code Quality

  • I ran make format, make lint, and make format-check
  • For Swift/OpenMedKit changes, I ran make format-swift and make lint-swift
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

Dependencies

  • I have not added any new dependencies
  • OR I have added new dependencies and they are justified because: ____

Checklist

  • I have read the contributing guidelines
  • My commits have clear, descriptive messages
  • I have squashed/organized my commits appropriately

Related Issues

Closes #1486

Screenshots/Examples

cf cc e1 d5 20 d5 cf e8 cc da converts to रमेश शर्मा and encodes back to the identical ISCII bytes.

@maziyarpanahi maziyarpanahi added roadmap-v2 OpenMed V2 roadmap backlog feature New capability P2 Medium labels Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New capability P2 Medium roadmap-v2 OpenMed V2 roadmap backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Legacy ISCII and legacy-font (ASCII-remapped) to Unicode conversion for old Indian clinical and administrative records

1 participant