Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.1 KB

README.md

File metadata and controls

45 lines (35 loc) · 1.1 KB

detect.js

When handling a Sanskrit string, it's almost always best to explicitly state its transliteration scheme. This avoids embarrassing errors with words like pitRRIn. But most of the time, it's possible to infer the encoding from the text itself.

detect.js automatically detects a string's transliteration scheme:

detect('pitRRIn') == Scheme.ITRANS
detect('pitRRn') == Scheme.HK
detect('pitFn') == Scheme.SLP1
detect('पितॄन्') == Scheme.Devanagari
detect('পিতৄন্') == Scheme.Bengali

Supported schemes

All schemes are attributes on the Scheme object. You can also just use the scheme name:

Scheme.IAST == 'IAST'
Scheme.Devanagari == 'Devanagari'

Scripts:

  • Bengali ('Bengali')
  • Devanagari ('Devanagari')
  • Gujarati ('Gujarati')
  • Gurmukhi ('Gurmukhi')
  • Kannada ('Kannada')
  • Malayalam ('Malayalam')
  • Oriya ('Oriya')
  • Tamil ('Tamil')
  • Telugu ('Telugu')

Romanizations:

  • Harvard-Kyoto ('HK')
  • IAST ('IAST')
  • ITRANS ('ITRANS')
  • Kolkata ('Kolkata')
  • SLP1 ('SLP1')
  • Velthuis ('Velthuis')