interscript / maps

Script conversion maps for Interscript
2 stars 1 forks source link

Add ISO 233-2 system for Arabic #3

Closed ronaldtse closed 3 years ago

ronaldtse commented 3 years ago

This is a reimplementation of interscript/interscript#703 in the interscript v2 syntax.

This fixes interscript/interscript#451 .

Screenshot 2021-07-05 at 9 19 32 AM Screenshot 2021-07-05 at 9 19 57 AM Screenshot 2021-07-05 at 9 00 29 AM Screenshot 2021-07-05 at 9 20 18 AM Screenshot 2021-07-05 at 8 59 54 AM
ronaldtse commented 3 years ago

Failures:

Failures:

  1) Interscript Interscript::Interpreter iso-ara-Arab-Latn-233-2-1993 system test for مِصر
     Failure/Error: expect(result).to eq(expected)

       expected: "Miṣr"
            got: "مiصر"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  2) Interscript Interscript::Interpreter iso-ara-Arab-Latn-233-2-1993 system test for قَطَر
     Failure/Error: expect(result).to eq(expected)

       expected: "Qaṭar"
            got: "قaطaر"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  3) Interscript Interscript::Interpreter iso-ara-Arab-Latn-233-2-1993 system test for الجُمهُورِيَّة العِرَاقِيَّة
     Failure/Error: expect(result).to eq(expected)

       expected: "Al Ǧumhuwriyaẗ al ‘Ira’qiyaẗ"
            got: "Âلجuمهuwرiyaẗ Âل‘iرa’قiyaẗ"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  4) Interscript Interscript::Interpreter iso-ara-Arab-Latn-233-2-1993 system test for جُمهُورِيَّة مِصر العَرَبِيَّة
     Failure/Error: expect(result).to eq(expected)

       expected: "Ǧumhuwriyaẗ Miṣr al ‘Arabiyaẗ"
            got: "جuمهuwرiyaẗ مiصر Âل‘aرaبiyaẗ"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  5) Interscript Interscript::Interpreter iso-ara-Arab-Latn-233-2-1993 system test for الرِيَاض
     Failure/Error: expect(result).to eq(expected)

       expected: "Ar Riya’ḍ"
            got: "Âلرiya’ض"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  6) Interscript Interscript::Interpreter iso-ara-Arab-Latn-233-2-1993 system test for الشارِقة
     Failure/Error: expect(result).to eq(expected)

       expected: "Aš Šâriqaẗ"
            got: "Âلشâرiقaẗ"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  7) Interscript Interscript::Compiler::Ruby iso-ara-Arab-Latn-233-2-1993 system test for مِصر
     Failure/Error: expect(result).to eq(expected)

       expected: "Miṣr"
            got: "مiصر"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  8) Interscript Interscript::Compiler::Ruby iso-ara-Arab-Latn-233-2-1993 system test for قَطَر
     Failure/Error: expect(result).to eq(expected)

       expected: "Qaṭar"
            got: "قaطaر"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  9) Interscript Interscript::Compiler::Ruby iso-ara-Arab-Latn-233-2-1993 system test for الجُمهُورِيَّة العِرَاقِيَّة
     Failure/Error: expect(result).to eq(expected)

       expected: "Al Ǧumhuwriyaẗ al ‘Ira’qiyaẗ"
            got: "Âلجuمهuwرiyaẗ Âل‘iرa’قiyaẗ"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  10) Interscript Interscript::Compiler::Ruby iso-ara-Arab-Latn-233-2-1993 system test for جُمهُورِيَّة مِصر العَرَبِيَّة
      Failure/Error: expect(result).to eq(expected)

        expected: "Ǧumhuwriyaẗ Miṣr al ‘Arabiyaẗ"
             got: "جuمهuwرiyaẗ مiصر Âل‘aرaبiyaẗ"

        (compared using ==)
      # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
      # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  11) Interscript Interscript::Compiler::Ruby iso-ara-Arab-Latn-233-2-1993 system test for الرِيَاض
      Failure/Error: expect(result).to eq(expected)

        expected: "Ar Riya’ḍ"
             got: "Âلرiya’ض"

        (compared using ==)
      # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
      # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  12) Interscript Interscript::Compiler::Ruby iso-ara-Arab-Latn-233-2-1993 system test for الشارِقة
      Failure/Error: expect(result).to eq(expected)

        expected: "Aš Šâriqaẗ"
             got: "Âلشâرiقaẗ"

        (compared using ==)
      # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
      # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  13) Interscript Interscript::Compiler::Javascript iso-ara-Arab-Latn-233-2-1993 system test for مِصر
      Failure/Error: expect(result).to eq(expected)

        expected: "Miṣr"
             got: "مiصر"

        (compared using ==)
      # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
      # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  14) Interscript Interscript::Compiler::Javascript iso-ara-Arab-Latn-233-2-1993 system test for قَطَر
      Failure/Error: expect(result).to eq(expected)

        expected: "Qaṭar"
             got: "قaطaر"

        (compared using ==)
      # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
      # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  15) Interscript Interscript::Compiler::Javascript iso-ara-Arab-Latn-233-2-1993 system test for الجُمهُورِيَّة العِرَاقِيَّة
      Failure/Error: expect(result).to eq(expected)

        expected: "Al Ǧumhuwriyaẗ al ‘Ira’qiyaẗ"
             got: "Âلجuمهuwرiyaẗ Âل‘iرa’قiyaẗ"

        (compared using ==)
      # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
      # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  16) Interscript Interscript::Compiler::Javascript iso-ara-Arab-Latn-233-2-1993 system test for جُمهُورِيَّة مِصر العَرَبِيَّة
      Failure/Error: expect(result).to eq(expected)

        expected: "Ǧumhuwriyaẗ Miṣr al ‘Arabiyaẗ"
             got: "جuمهuwرiyaẗ مiصر Âل‘aرaبiyaẗ"

        (compared using ==)
      # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
      # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  17) Interscript Interscript::Compiler::Javascript iso-ara-Arab-Latn-233-2-1993 system test for الرِيَاض
      Failure/Error: expect(result).to eq(expected)

        expected: "Ar Riya’ḍ"
             got: "Âلرiya’ض"

        (compared using ==)
      # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
      # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  18) Interscript Interscript::Compiler::Javascript iso-ara-Arab-Latn-233-2-1993 system test for الشارِقة
      Failure/Error: expect(result).to eq(expected)

        expected: "Aš Šâriqaẗ"
             got: "Âلشâرiقaẗ"

        (compared using ==)
      # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
      # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

Finished in 39.32 seconds (files took 3.69 seconds to load)
23313 examples, 18 failures

@AhMohsen46 can you help fix these? Thanks!

ronaldtse commented 3 years ago

@AhMohsen46 I was wondering if we can actually inherit the rules from the more complex ISO 233 system, and then translate the output into the simpler ISO 233-2 system?

ronaldtse commented 3 years ago

We also need to add these examples:

Screenshot 2021-07-05 at 9 00 29 AM Screenshot 2021-07-05 at 8 59 54 AM
ronaldtse commented 3 years ago

Less failures now after supplementing rules:

Failures:

  1) Interscript Interscript::Interpreter iso-ara-Arab-Latn-233-2-1993 system test for الرِيَاض
     Failure/Error: expect(result).to eq(expected)

       expected: "Ar Riya’ḍ"
            got: "Al Riya’ḍ"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  2) Interscript Interscript::Interpreter iso-ara-Arab-Latn-233-2-1993 system test for الشارِقة
     Failure/Error: expect(result).to eq(expected)

       expected: "Aš Šâriqaẗ"
            got: "Al Šâriqaẗ"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  3) Interscript Interscript::Compiler::Ruby iso-ara-Arab-Latn-233-2-1993 system test for الرِيَاض
     Failure/Error: expect(result).to eq(expected)

       expected: "Ar Riya’ḍ"
            got: "Al Riya’ḍ"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  4) Interscript Interscript::Compiler::Ruby iso-ara-Arab-Latn-233-2-1993 system test for الشارِقة
     Failure/Error: expect(result).to eq(expected)

       expected: "Aš Šâriqaẗ"
            got: "Al Šâriqaẗ"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  5) Interscript Interscript::Compiler::Javascript iso-ara-Arab-Latn-233-2-1993 system test for الرِيَاض
     Failure/Error: expect(result).to eq(expected)

       expected: "Ar Riya’ḍ"
            got: "Al Riya’ḍ"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

  6) Interscript Interscript::Compiler::Javascript iso-ara-Arab-Latn-233-2-1993 system test for الشارِقة
     Failure/Error: expect(result).to eq(expected)

       expected: "Aš Šâriqaẗ"
            got: "Al Šâriqaẗ"

       (compared using ==)
     # ./spec/interscript_spec.rb:32:in `block (8 levels) in <top (required)>'
     # ./spec/interscript_spec.rb:30:in `block (7 levels) in <top (required)>'

Finished in 38.32 seconds (files took 3.53 seconds to load)
23313 examples, 6 failures
AhMohsen46 commented 3 years ago

@ronaldtse thanks for the help!, probably the yaml version was not being tested at all and it had to be converted to the new format? the failing tests are due to sun letters I'll check whether the doc is using sun letters rules or using regular definite article "ال - al"

AhMohsen46 commented 3 years ago

ah, I think I found it here: https://github.com/interscript/maps/blob/87c5f0eccb58ac3be80395688536dac146701ead/maps/iso-ara-Arab-Latn-233-2-1993.imp#L103-L116 the rules are there, needs to be using "boundary" instead of \b will do that in a second

ronaldtse commented 3 years ago

Thanks @AhMohsen46 , the tests are passing. Can your help add the remaining examples as tests?

AhMohsen46 commented 3 years ago

@ronaldtse yessir, working on them now!

ronaldtse commented 3 years ago

@AhMohsen46 any updates here? thanks.

ronaldtse commented 3 years ago

Ping @AhMohsen46

ronaldtse commented 3 years ago

Thank you @AhMohsen46 !