shabados / gurmukhi-utils

Utilities library for converting, analyzing, and testing Gurmukhi strings.
MIT License
30 stars 9 forks source link

stripEndings removing number from translation #197

Closed sarabveer closed 1 year ago

sarabveer commented 2 years ago

https://github.com/shabados/gurmukhi-utils/blob/2d193029dac68408fb659231ea523d683e582ac9/test/stripEndings.spec.js#L48

sarabveer commented 2 years ago

Similar situation here, 1753 is part of the translation

https://github.com/shabados/gurmukhi-utils/blob/2d193029dac68408fb659231ea523d683e582ac9/test/stripEndings.spec.js#L103

bhajneet commented 2 years ago

As indicated by the comment/documentation:

Not designed for headings or Sirlekhs.

bhajneet commented 2 years ago

I didn't see the second comment. Re-opening as an issue and renaming title.

InderdeepBajwa commented 2 years ago

This is caused by: https://github.com/shabados/gurmukhi-utils/blob/bd76ea455f50af141593396b1f0b6c2ab24bd9d3/lib/stripEndings.js#L31

bhajneet commented 1 year ago

This is fixed in python. The following tests pass.


    {
      "name": "remove line endings - negative",
      "functions": ["rle"],
      "type": "is",
      "assertions": {
        "ਮਹਲਾ ੧": "ਮਹਲਾ ੧",
        "ਮਹਲਾ ੫": "ਮਹਲਾ ੫",
        "mahalaa 1": "mahalaa 1",
        "महला ५": "महला ५",
        "It was Bikrami Samvat 1753": "It was Bikrami Samvat 1753"
      }
    }