Skip to content

Commit

Permalink
Merge pull request #125 from ShabadOS/123-three-letter-words-with-hah…
Browse files Browse the repository at this point in the history
…a-in-middle

123 Transliteration Fixes 

#Minor release
  • Loading branch information
Harjot1Singh authored Mar 18, 2020
2 parents 1777b1f + 0234b2b commit f00d5ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/toEnglish.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ const replacements = [
[ /i(.)/g, '$1i' ], // Place sihari in correct position
[ /(.)[i]([R®H§´ÍÏ眘†])/ug, '$1$2i' ], // Move sihari in front of pairin akhars
[ new RegExp( `(\\S[^ha])([iu])([\\s$${vishraams.join( '' )}])`, 'ug' ), '$1$3' ], // Remove trailing Aunkar (u) and Sihari (i) except when on Haha (h), Ooraa (a), or on a standalone akhar
[ new RegExp( `(\\b\\S)h([^iIuUyYwWoONM§¨®´µÍÏçüœˆ˜†]\\b|[${vishraams.join( '' )}])`, 'ug' ), '$1yh$2' ], // Add y to three consonant letter words with haha in middle per issue #123
]

// Rules required to add in an extra a letter - all must be true
Expand Down Expand Up @@ -198,6 +199,7 @@ const finalReplacements = Object.entries( {
nn: 'n',
eeaa: 'eea',
eiaa: 'eaa',
eio: 'eo',
anm: 'am',
[ `ahi${spaceCharsRegex}` ]: 'eh$1',
[ `yhi${spaceCharsRegex}` ]: 'yeh$1',
Expand Down
4 changes: 3 additions & 1 deletion test/toEnglish.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const transliterations = [
[ 'ਅਬ੍ਰਯਕਤ ਅੰਗ ॥', 'abrayakat ang |' ],
[ 'ਜਗੰਨਾਥ ਜਗਦੀਸੁਰ ਕਰਤੇ ਸਭ ਵਸਗਤਿ ਹੈ ਹਰਿ ਕੇਰੀ ॥', 'jaganaath jagadeesur karate sabh vasagat hai har keree |' ],
[ 'ਆਦਿ ਸਚੁ ਜੁਗਾਦਿ ਸਚੁ ॥', 'aad sach jugaad sach |' ],
[ 'ਸਹਸ ਸਿਆਣਪਾ ਲਖ ਹੋਹਿ ਤ ਇਕ ਨ ਚਲੈ ਨਾਲਿ ॥', 'sahas siaanapaa lakh hohi ta ik na chalai naal |' ],
[ 'ਸਹਸ ਸਿਆਣਪਾ ਲਖ ਹੋਹਿ ਤ ਇਕ ਨ ਚਲੈ ਨਾਲਿ ॥', 'sehas siaanapaa lakh hohi ta ik na chalai naal |' ],
[ 'ੴ ਸਤਿ ਨਾਮੁ ਕਰਤਾ ਪੁਰਖੁ ਨਿਰਭਉ ਨਿਰਵੈਰੁ ਅਕਾਲ ਮੂਰਤਿ ਅਜੂਨੀ ਸੈਭੰ ਗੁਰ ਪ੍ਰਸਾਦਿ ॥', 'ik oankaar sat naam karataa purakh nirbhau niravair akaal moorat ajoonee saibhan gur prasaad |' ],
[ 'ਹੁਕਮੀ ਹੁਕਮੁ ਚਲਾਏ ਰਾਹੁ ॥', 'hukamee hukam chalaae raahu |' ],
[ 'ਤਿਨ ਕੇ ਨਾਮ ਅਨੇਕ ਅਨੰਤ ॥', 'tin ke naam anek anant |' ],
Expand All @@ -23,6 +23,8 @@ const transliterations = [
[ 'ਘੜੀ ਮੂਰਤ ਸਿਮਰਤ ਪਲ ਵੰਞਹਿ ਜੀਵਣੁ ਸਫਲੁ ਤਿਥਾਈ ਜੀਉ ॥੧॥', 'gharree moorat simarat pal vanyeh jeevan safal tithaaee jeeo |1|' ],
[ 'ਹਰਿ ਹਰਿ ਹਰਿ ਗੁਨ ਗਾਵਹੁ ॥', 'har har har gun gaavahu |' ],
[ 'ਹੁਕਮੈ ਅੰਦਰਿ. ਸਭੁ ਕੋ; ਬਾਹਰਿ ਹੁਕਮ. ਨ ਕੋਇ ॥', 'hukamai andar. sabh ko; baahar hukam. na koe |' ],
[ 'ਸਹਜ; ਸਸਹਜ ਅਨਹਦ ਰਹਤ ਕਹਤ ਪਹਰ, ਸਹਸ ਮਹਲ ਟਹਲ ਕਹਨਨ ਕਹਨ', 'sehaj; sasahaj anahad rehat kehat pehar, sehas mehal ttehal kahanan kehan' ],
[ 'ਸਭ ਭਇਓ ਪਰਾਇਓ', 'sabh bheo paraaeo' ],
]

describe( 'toEnglish()', () => {
Expand Down

0 comments on commit f00d5ca

Please sign in to comment.