@@ -68,9 +68,11 @@ public TreeSet<String> getSampleSentences(String lang) {
6868 //GERMAN
6969 if (lang .equals (Language .DE .toValue ())){
7070 samples .add ("Zeig mir die aktuellen Corona Daten aus Deutschland." );
71+ samples .add ("Wie viele Coronavirus Fälle gibt es in Deutschland?" );
7172 //OTHER
7273 }else {
7374 samples .add ("Show me Corona data from England." );
75+ samples .add ("How many Coronavirus cases are there in the UK?" );
7476 }
7577 return samples ;
7678 }
@@ -125,13 +127,13 @@ public ServiceInfo getInfo(String language){
125127 //Regular expression triggers
126128 //NOTE: use 'normalized' text here, e.g. lower-case and no special characters ?, !, ., ', etc. ... for ä, ö, ü, ß, ... use ae, oe, ue, ss, ...
127129 info .setCustomTriggerRegX (".*\\ b("
128- + "(corona|covid(-19|)) (data|numbers|cases|deaths)|"
129- + "(sick|ill|died|deaths) (by|through) (corona|covid(-19|))"
130+ + "(corona|covid(-19|))((-| |)virus|) (data|numbers|cases|deaths)|"
131+ + "(sick|ill|died|deaths) (by|through)( the|) (corona|covid(-19|))"
130132 + ")\\ b.*" , EN
131133 );
132134 info .setCustomTriggerRegX (".*\\ b("
133- + "(corona|covid(-19|)) (daten|zahlen|faelle|tote|kranke)|"
134- + "(erkrankt|krank(e|)|gestorben|tote) (an|durch) (corona|covid(-19|))"
135+ + "(corona|covid(-19|))((-| |)virus|)( |-|) (daten|zahlen|faelle|tote|kranke)|"
136+ + "(erkrankt|krank(e|)|gestorben|tote) (an|durch)( den| das|) (corona|covid(-19|))"
135137 + ")\\ b.*" , DE
136138 );
137139 info .setCustomTriggerRegXscoreBoost (3 ); //boost service to increase priority over similar ones
@@ -224,7 +226,7 @@ public ServiceResult getResult(NluResult nluResult){
224226 * <br>
225227 * See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3 <br>
226228 * <br>
227- * Currently only supports: England, Germany, Spain, Italy, Brazil and USA.
229+ * Currently only supports a few countries, e.g. : England, Germany, Spain, Italy, Brazil, USA.
228230 */
229231 public static class CountryCode3 extends CustomParameter {
230232
@@ -247,21 +249,26 @@ public static class CountryCode3 extends CustomParameter {
247249 private static String usaRegEx_en = "american|america|united states|usa" ;
248250 private static String usaRegEx_de = "amerikanisch(en|e|)|amerika|usa" ;
249251
252+ private static String turRegEx_en = "turkish|turkey|tur" ;
253+ private static String turRegEx_de = "tuerkisch(en|e|)|tuerkei|tur" ;
254+
250255 private static String all_en =
251256 gbrRegEx_en + "|" +
252257 deuRegEx_en + "|" +
253258 espRegEx_en + "|" +
254259 itaRegEx_en + "|" +
255260 braRegEx_en + "|" +
256- usaRegEx_en
261+ usaRegEx_en + "|" +
262+ turRegEx_en
257263 ;
258264 private static String all_de =
259265 gbrRegEx_de + "|" +
260266 deuRegEx_de + "|" +
261267 espRegEx_de + "|" +
262268 itaRegEx_de + "|" +
263269 braRegEx_de + "|" +
264- usaRegEx_de
270+ usaRegEx_de + "|" +
271+ turRegEx_de
265272 ;
266273
267274 @ Override
@@ -288,6 +295,8 @@ public String extract(String input) {
288295 extracted = "BRA;;Brasilien;;" ;
289296 }else if (NluTools .stringContains (found , usaRegEx_de )){
290297 extracted = "USA;;USA;;" ;
298+ }else if (NluTools .stringContains (found , turRegEx_de )){
299+ extracted = "TUR;;Türkei;;" ;
291300 }
292301 //English
293302 }else if (this .language .equals (LANGUAGES .EN )){
@@ -299,15 +308,17 @@ public String extract(String input) {
299308 }else if (NluTools .stringContains (found , gbrRegEx_en )){
300309 extracted = "GBR;;England;;" ;
301310 }else if (NluTools .stringContains (found , deuRegEx_en )){
302- extracted = "DEU;;Deutschland ;;" ;
311+ extracted = "DEU;;Germany ;;" ;
303312 }else if (NluTools .stringContains (found , espRegEx_en )){
304- extracted = "ESP;;Spanien ;;" ;
313+ extracted = "ESP;;Spain ;;" ;
305314 }else if (NluTools .stringContains (found , itaRegEx_en )){
306- extracted = "ITA;;Italien ;;" ;
315+ extracted = "ITA;;Italy ;;" ;
307316 }else if (NluTools .stringContains (found , braRegEx_en )){
308- extracted = "BRA;;Brasilien ;;" ;
317+ extracted = "BRA;;Brazil ;;" ;
309318 }else if (NluTools .stringContains (found , usaRegEx_en )){
310319 extracted = "USA;;USA;;" ;
320+ }else if (NluTools .stringContains (found , turRegEx_en )){
321+ extracted = "TUR;;Turkey;;" ;
311322 }
312323
313324 //Other languages
0 commit comments