Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Hindi parsing patterns #1434

Conversation

lovelovedokidoki
Copy link
Contributor

Hindi parsing locale data was missing proper ordinal number support and had a few mismatches with abbreviated months and parsing june and july as january.

Please be aware, I have no proficiency in Hindi. I simply reverse engineered the existing locale data to get the parser to yield the expected results.

Test results from the test defined in #1423:

hi, P format
  ✓ parse(06/07/2048) = 2048-7-6
  ✓ parse(23/05/2035) = 2035-5-23 (1ms)
  ✓ parse(04/05/2083) = 2083-5-4
  ✓ parse(10/03/2080) = 2080-3-10
  ✓ parse(08/05/2046) = 2046-5-8
  ✓ parse(31/07/2081) = 2081-7-31
  ✓ parse(17/06/2107) = 2107-6-17 (1ms)
  ✓ parse(07/10/2036) = 2036-10-7
  ✓ parse(19/11/2077) = 2077-11-19
  ✓ parse(15/09/2080) = 2080-9-15
hi, PP format
  ✓ parse(20 फ़र, 2118) = 2118-2-20 (1ms)
  ✓ parse(22 अक्तू, 2109) = 2109-10-22
  ✓ parse(1 जून, 2097) = 2097-6-1
  ✓ parse(13 सित, 2066) = 2066-9-13
  ✓ parse(8 सित, 2091) = 2091-9-8
  ✓ parse(23 सित, 2073) = 2073-9-23 (1ms)
  ✓ parse(15 नव, 2039) = 2039-11-15
  ✓ parse(16 जुल, 2064) = 2064-7-16
  ✓ parse(14 नव, 2067) = 2067-11-14
  ✓ parse(1 अग, 2100) = 2100-8-1
hi, PPP format
  ✓ parse(२८ जनवरी, 2023) = 2023-1-28 (1ms)
  ✓ parse(२६ सितंबर, 2116) = 2116-9-26
  ✓ parse(१२ जनवरी, 2064) = 2064-1-12
  ✓ parse(३० मार्च, 2119) = 2119-3-30
  ✓ parse(११ मार्च, 2026) = 2026-3-11 (1ms)
  ✓ parse(१२ सितंबर, 2056) = 2056-9-12
  ✓ parse(२२ अगस्त, 2054) = 2054-8-22
  ✓ parse(२७ अक्तूबर, 2085) = 2085-10-27
  ✓ parse(२४ अक्तूबर, 2028) = 2028-10-24
  ✓ parse(१४ जुलाई, 2096) = 2096-7-14 (1ms)
hi, PPPP format
  ✓ parse(रविवार, २५ अक्तूबर, 2054) = 2054-10-25
  ✓ parse(सोमवार, ७ जनवरी, 2086) = 2086-1-7
  ✓ parse(बुधवार, ७ मार्च, 2085) = 2085-3-7
  ✓ parse(शनिवार, ८ फ़रवरी, 2110) = 2110-2-8 (1ms)
  ✓ parse(बुधवार, २८ अगस्त, 2097) = 2097-8-28
  ✓ parse(मंगलवार, १० अक्तूबर, 2034) = 2034-10-10
  ✓ parse(रविवार, ७ अप्रैल, 2058) = 2058-4-7
  ✓ parse(सोमवार, २७ अगस्त, 2040) = 2040-8-27 (1ms)
  ✓ parse(मंगलवार, ६ जुलाई, 2094) = 2094-7-6
  ✓ parse(मंगलवार, १३ फ़रवरी, 2057) = 2057-2-13

@lovelovedokidoki lovelovedokidoki force-pushed the lmolgaardtams-fix-hindi-parsing-patterns branch from 018adae to 6dcfdc1 Compare September 18, 2019 19:41
@lovelovedokidoki lovelovedokidoki force-pushed the lmolgaardtams-fix-hindi-parsing-patterns branch from 6dcfdc1 to 428f813 Compare September 19, 2019 08:25
Copy link
Member

@kossnocorp kossnocorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants