-
Notifications
You must be signed in to change notification settings - Fork 269
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
base: master
Are you sure you want to change the base?
[GSOC'24 Amharic chapter] Add Amharic configurations for duration parser #764
Conversation
There was a problem hiding this 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.
core/src/main/scala/org/dbpedia/extraction/config/dataparser/DurationParserConfig.scala
Outdated
Show resolved
Hide resolved
@@ -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*/ "ኪሎሜትር በሰዓት"))); |
There was a problem hiding this comment.
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...
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*/ "ኪሎሜትር በሰዓት"))); |
There was a problem hiding this comment.
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
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)); |
There was a problem hiding this comment.
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
There was a problem hiding this 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*/ "ኪሎሜትር በሰዓት"))); |
There was a problem hiding this comment.
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
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)); |
There was a problem hiding this comment.
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 <tthibodeau@openlinksw.com>
Quality Gate failedFailed conditions |
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]""",
""