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

[GSOC'24 Amharic chapter] Add Amharic configurations for duration parser #764

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Meti-Adane
Copy link

  • Added Ontology Datatypes for Amharic
  • Added amharic configurations and tests for duration parser.

FYI: running the tests currently MIGHT fail due to a bug in the duration parser that drops non latin characters as mentioned in Issue 760. A quick yet not so inefficient fix could be updating the regex here with

replaceAll(s"""[^\'\"$timeUnitsRegex]""", ""

Copy link
Contributor

@TallTed TallTed left a comment

Choose a reason for hiding this comment

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

Tweaks for humans. Singular "degree" should only happen when the value is "one"; every other value should be plural "degrees". Celsius, Fahrenheit, Rankine should always be capitalized.

@@ -458,9 +458,9 @@ object OntologyDatatypes
types :::= builder.build

builder.addDimension("Speed");
builder.addUnit(new StandardUnitDatatype("kilometrePerHour", Set("km/h","kmh","kilometre per hour",/*el*/ "χιλιόμετρα ανά ώρα")));
builder.addUnit(new StandardUnitDatatype("kilometrePerHour", Set("km/h","kmh","kilometre per hour",/*el*/ "χιλιόμετρα ανά ώρα", /*am*/ "ኪሎሜትር በሰዓት")));
Copy link
Contributor

Choose a reason for hiding this comment

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

kilometer vs kilometre, and plural vs singular vary regionally (not just by language). This might need to be more complicated...

Suggested change
builder.addUnit(new StandardUnitDatatype("kilometrePerHour", Set("km/h","kmh","kilometre per hour",/*el*/ "χιλιόμετρα ανά ώρα", /*am*/ "ኪሎሜትር በሰዓት")));
builder.addUnit(new StandardUnitDatatype("kilometersPerHour", Set("km/h","kmh","kilometers per hour",/*el*/ "χιλιόμετρα ανά ώρα", /*am*/ "ኪሎሜትር በሰዓት")));

Copy link
Member

Choose a reason for hiding this comment

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

we could add both versions in the list to accommodate both variations

Comment on lines +472 to 474
builder.addUnit(new FactorUnitDatatype("degreeCelsius", Set("°C","degree celsius","C","Celsius",/*el*/ "βαθμοί", /*am*/ "ሴልሲየስ"), 1.0, 273.15));
builder.addUnit(new FactorUnitDatatype("degreeFahrenheit", Set("°F","F","Fahrenheit","degree fahrenheit"), 5.0 / 9.0, 459.67));
builder.addUnit(new FactorUnitDatatype("degreeRankine", Set("°R","R","degree rankine"), 5.0 / 9.0, 0));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
builder.addUnit(new FactorUnitDatatype("degreeCelsius", Set("°C","degree celsius","C","Celsius",/*el*/ "βαθμοί", /*am*/ "ሴልሲየስ"), 1.0, 273.15));
builder.addUnit(new FactorUnitDatatype("degreeFahrenheit", Set("°F","F","Fahrenheit","degree fahrenheit"), 5.0 / 9.0, 459.67));
builder.addUnit(new FactorUnitDatatype("degreeRankine", Set("°R","R","degree rankine"), 5.0 / 9.0, 0));
builder.addUnit(new FactorUnitDatatype("degreesCelsius", Set("°C","degrees celsius","C","Celsius",/*el*/ "βαθμοί", /*am*/ "ሴልሲየስ"), 1.0, 273.15));
builder.addUnit(new FactorUnitDatatype("degreesFahrenheit", Set("°F","F","Fahrenheit","degrees Fahrenheit"), 5.0 / 9.0, 459.67));
builder.addUnit(new FactorUnitDatatype("degreesRankine", Set("°R","R","degrees Rankine"), 5.0 / 9.0, 0));

Copy link
Member

Choose a reason for hiding this comment

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

agree, using degrees instead of degree is more accurate

Copy link
Member

@jimkont jimkont left a comment

Choose a reason for hiding this comment

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

Looks great 👍 we could also incorporate @TallTed 's comments, even though not strictly part of this changeset

@@ -458,9 +458,9 @@ object OntologyDatatypes
types :::= builder.build

builder.addDimension("Speed");
builder.addUnit(new StandardUnitDatatype("kilometrePerHour", Set("km/h","kmh","kilometre per hour",/*el*/ "χιλιόμετρα ανά ώρα")));
builder.addUnit(new StandardUnitDatatype("kilometrePerHour", Set("km/h","kmh","kilometre per hour",/*el*/ "χιλιόμετρα ανά ώρα", /*am*/ "ኪሎሜትር በሰዓት")));
Copy link
Member

Choose a reason for hiding this comment

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

we could add both versions in the list to accommodate both variations

Comment on lines +472 to 474
builder.addUnit(new FactorUnitDatatype("degreeCelsius", Set("°C","degree celsius","C","Celsius",/*el*/ "βαθμοί", /*am*/ "ሴልሲየስ"), 1.0, 273.15));
builder.addUnit(new FactorUnitDatatype("degreeFahrenheit", Set("°F","F","Fahrenheit","degree fahrenheit"), 5.0 / 9.0, 459.67));
builder.addUnit(new FactorUnitDatatype("degreeRankine", Set("°R","R","degree rankine"), 5.0 / 9.0, 0));
Copy link
Member

Choose a reason for hiding this comment

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

agree, using degrees instead of degree is more accurate

…urationParserConfig.scala

Co-authored-by: Ted Thibodeau Jr <[email protected]>
Copy link

sonarcloud bot commented Sep 8, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
65.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

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

Successfully merging this pull request may close these issues.

3 participants