Skip to main content

uroman 1.1.1 copy "uroman: ^1.1.1" to clipboard
uroman: ^1.1.1 copied to clipboard

Universal Romanizer converts text in virtually any script into Latin characters.

example/uroman_example.dart

import 'package:uroman/uroman.dart';

void main() {
  // Initialize uroman with embedded data (works on VM, Flutter, and Web)
  final uroman = Uroman();

  // 1. Basic romanization across various writing systems
  print('--- Basic Romanization ---');
  print('Russian:  ${uroman.romanizeString("Игорь Стравинский")}');
  print('Greek:    ${uroman.romanizeString("Καλημέρα κόσμε")}');
  print('Arabic:   ${uroman.romanizeString("مرحبا بالعالم")}');
  print('Chinese:  ${uroman.romanizeString("三千二百五十四")}');
  print('Japanese: ${uroman.romanizeString("ちょっとまってください")}');

  // 2. Language-specific romanization via ISO 639-3 language codes
  print('\n--- Language-Specific Romanization ---');
  print('Default:   ${uroman.romanizeString("Игорь")}'); // Igor
  print('Ukrainian: ${uroman.romanizeString("Игорь", lcode: "ukr")}'); // Yhor

  // 3. Offset tracking (Python code points + native Dart/Flutter UTF-16 offsets)
  print('\n--- Edge Inspection & Offsets ---');
  final edges =
      uroman.romanizeString('ちょっと', format: RomFormat.edges) as List<Edge>;

  for (final edge in edges) {
    print(
      'Span [cp: ${edge.start}..${edge.end}, utf16: ${edge.utf16Start}..${edge.utf16End}]: '
      '${edge.txt} (${edge.type})',
    );
  }
}
1
likes
150
points
77
downloads

Documentation

API reference

Publisher

verified publisherethnos.dev

Weekly Downloads

Universal Romanizer converts text in virtually any script into Latin characters.

Repository (GitHub)
View/report issues

Topics

#romanization #transliteration #unicode #linguistics #nlp

License

unknown (license)

Dependencies

args

More

Packages that depend on uroman