diff --git a/core/src/main/scala/org/dbpedia/extraction/config/dataparser/DurationParserConfig.scala b/core/src/main/scala/org/dbpedia/extraction/config/dataparser/DurationParserConfig.scala index 37978f11cd..06fd80c935 100644 --- a/core/src/main/scala/org/dbpedia/extraction/config/dataparser/DurationParserConfig.scala +++ b/core/src/main/scala/org/dbpedia/extraction/config/dataparser/DurationParserConfig.scala @@ -75,6 +75,7 @@ object DurationParserConfig "ቀን" -> "day", "ቀናት" -> "day", "ቀኖች" -> "day", + "ቀናቶች" -> "day", "month" -> "month", "months" -> "month", "ወር" -> "month", diff --git a/core/src/main/scala/org/dbpedia/extraction/ontology/OntologyDatatypes.scala b/core/src/main/scala/org/dbpedia/extraction/ontology/OntologyDatatypes.scala index 67e23d7b1f..4c4cca654b 100644 --- a/core/src/main/scala/org/dbpedia/extraction/ontology/OntologyDatatypes.scala +++ b/core/src/main/scala/org/dbpedia/extraction/ontology/OntologyDatatypes.scala @@ -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*/ "ኪሎሜትር በሰዓት"))); builder.addUnit(new FactorUnitDatatype("metrePerSecond", Set("m/s","ms","metre per second"), 3.6)); - builder.addUnit(new FactorUnitDatatype("kilometrePerSecond", Set("km/s","kilometre per second"), 3600.0)); + builder.addUnit(new FactorUnitDatatype("kilometrePerSecond", Set("km/s","kilometre per second", /*am*/ "ኪሎሜትር በሰከንድ"), 3600.0)); builder.addUnit(new FactorUnitDatatype("milePerHour", Set("mph","mi/h","mile per hour"), 1.60934)); builder.addUnit(new FactorUnitDatatype("footPerSecond", Set("ft/s","foot per second"), 0.0003048333333)); builder.addUnit(new FactorUnitDatatype("footPerMinute", Set("ft/min","foot per minute"), 0.01829)); @@ -469,21 +469,21 @@ object OntologyDatatypes builder.addDimension("Temperature"); builder.addUnit(new StandardUnitDatatype("kelvin", Set("K","kelvin",/*el*/ "Κ","κέλβιν"))); - builder.addUnit(new FactorUnitDatatype("degreeCelsius", Set("°C","degree celsius","C","Celsius",/*el*/ "βαθμοί"), 1.0, 273.15)); + 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)); types :::= builder.build builder.addDimension("Time"); - builder.addUnit(new StandardUnitDatatype("second", Set("s","sec","secs","second","seconds",/*el*/ "δ","δευτερόλεπτα"))); + builder.addUnit(new StandardUnitDatatype("second", Set("s","sec","secs","second","seconds",/*el*/ "δ","δευτερόλεπτα", /*am*/ "ሴኮንድ"))); //Add commonly used fractions of second builder.addUnit(new FactorUnitDatatype("millisecond", Set("ms","millisecond","milliseconds"), 0.001)); builder.addUnit(new FactorUnitDatatype("microsecond", Set("µs","microsecond","microseconds"), 1.0E-6)); builder.addUnit(new FactorUnitDatatype("nanosecond", Set("ns","nanosecond","nanoseconds"), 1.0E-9)); // end of fractions - builder.addUnit(new FactorUnitDatatype("minute", Set("m","min","min.","mins","minute","minutes",/*el*/ "λ","λεπτά"), 60.0)); - builder.addUnit(new FactorUnitDatatype("hour", Set("h","hr","hr.","hour","hours","std",/*el*/ "ω","ώρες","ώρα"), 3600.0)); - builder.addUnit(new FactorUnitDatatype("day", Set("d","days","day",/*el*/ "μ","μέρα","μέρες"), 86400.0)); + builder.addUnit(new FactorUnitDatatype("minute", Set("m","min","min.","mins","minute","minutes",/*el*/ "λ","λεπτά", /*am*/ "ደቂቃ", "ደቂቃዎች"), 60.0)); + builder.addUnit(new FactorUnitDatatype("hour", Set("h","hr","hr.","hour","hours","std",/*el*/ "ω","ώρες","ώρα", /*am*/ "ሰዓት", "ሰዓታት"), 3600.0)); + builder.addUnit(new FactorUnitDatatype("day", Set("d","days","day",/*el*/ "μ","μέρα","μέρες", /*am*/ "ቀን", "ቀናት", "ቀኖች", "ቀናቶች"), 86400.0)); types :::= builder.build builder.addDimension("Torque"); diff --git a/core/src/test/scala/org/dbpedia/extraction/dataparser/DurationParserTest.scala b/core/src/test/scala/org/dbpedia/extraction/dataparser/DurationParserTest.scala index 5bff1a21be..d9ef6ae5d0 100644 --- a/core/src/test/scala/org/dbpedia/extraction/dataparser/DurationParserTest.scala +++ b/core/src/test/scala/org/dbpedia/extraction/dataparser/DurationParserTest.scala @@ -137,6 +137,11 @@ class DurationParserTest extends FlatSpec with Matchers { parse("en", "Time", "2002-present") should equal (None) } + // Teset for amharic + "DurationParser" should "return 14400 seconds for ' el greek'" in + { + parse("el", "Time", " 4 ώρες").get should equal (14400.0) + } /** * Matcher to test if 2 values are approximately equal. diff --git a/core/src/test/scala/org/dbpedia/extraction/dataparser/GeoCoordinateParserTest.scala b/core/src/test/scala/org/dbpedia/extraction/dataparser/GeoCoordinateParserTest.scala index fb2ceaa74e..4701575666 100644 --- a/core/src/test/scala/org/dbpedia/extraction/dataparser/GeoCoordinateParserTest.scala +++ b/core/src/test/scala/org/dbpedia/extraction/dataparser/GeoCoordinateParserTest.scala @@ -18,6 +18,7 @@ class GeoCoordinateParserTest extends FlatSpec with Matchers { parse("fr", "51º12'00\"N 03º13'00\"E") should equal (Some(51.2,3.216666666666667)) } + "GeoCoordinateParser({{coord|51.2|N|31.2|E}}" should "return (51.2,31.2)) for French" in { parse("fr", "{{coord|51.2|N|31.2|E}}") should equal (Some(51.2,31.2)) @@ -27,7 +28,10 @@ class GeoCoordinateParserTest extends FlatSpec with Matchers parse("fr", "{{coord|51/12/N|03/13/E}}") should equal (Some(51.2,3.216666666666667)) } - + "GeoCoordinateParser (31º12'00\"N 03º13'00\"E)" should "return (31.2,3.216666666666667))" in + { + parse("am", "31º12'00\"N 03º13'00\"E") should equal (Some(31.2,3.216666666666667)) + } private val wikiParser = WikiParser.getInstance() private def parse(language : String, input : String) : Option[(Double, Double)] =