@Test public void testGetNormTextandPattern() throws Exception { System.out.println("getNormTextandPattern"); Timek instance = new Timek(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(new File(this.getClass().getResource("/time/timek-pattern-test.en-US.txt").toURI())), "UTF-8"))) { String line; int linen = 0; while ((line = reader.readLine()) != null) { linen++; if(!line.trim().isEmpty() && line.matches("[^\\|]+\\|\\|.+")){ System.out.println("testing (line "+linen+"): "+line); String [] test=line.trim().split("\\|\\|"); System.out.println("expected: "+test[1]); System.out.println("predicted: "+instance.getNormTextandPattern(test[0])); assertEquals(test[1], instance.getNormTextandPattern(test[0])); } } } if(FileUtils.URL_exists(this.getClass().getResource("/time/timek-pattern-test.es-ES.txt").toString())){ System.out.println("getNormTextandPattern ES-ES"); instance = new Timek(new Locale("es","ES")); try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(new File(this.getClass().getResource("/time/timek-pattern-test.es-ES.txt").toURI())), "UTF-8"))) { String line; int linen = 0; while ((line = reader.readLine()) != null) { linen++; if(!line.trim().isEmpty() && line.matches("[^\\|]+\\|\\|.+")){ System.out.println("testing (line "+linen+"): "+line); String [] test=line.trim().split("\\|\\|"); System.out.println("expected: "+test[1]); String predicted=instance.getNormTextandPattern(test[0]); System.out.println("predicted: "+predicted); assertEquals(test[1], predicted); } } } } }
public String getNormTextandPattern(String timex_text) { return getNormTextandPattern(timex_text, Boolean.FALSE); }
Timek { public String getNormTextandPattern(String timex_text) { return getNormTextandPattern(timex_text, Boolean.FALSE); } }
Timek { public String getNormTextandPattern(String timex_text) { return getNormTextandPattern(timex_text, Boolean.FALSE); } Timek();  Timek(Locale l);  Timek(Locale l, String resources_dir); }
Timek { public String getNormTextandPattern(String timex_text) { return getNormTextandPattern(timex_text, Boolean.FALSE); } Timek();  Timek(Locale l);  Timek(Locale l, String resources_dir); final String disambiguate(String text); final String removeUselessSymbols(String text); String getNormTextandPattern(String timex_text); String getNormTextandPattern(String timex_text, Boolean case_sensitive); }
Timek { public String getNormTextandPattern(String timex_text) { return getNormTextandPattern(timex_text, Boolean.FALSE); } Timek();  Timek(Locale l);  Timek(Locale l, String resources_dir); final String disambiguate(String text); final String removeUselessSymbols(String text); String getNormTextandPattern(String timex_text); String getNormTextandPattern(String timex_text, Boolean case_sensitive); static final String[] phraselist_names; public HashMap<String, PhraselistFile> phraselists; public TreeMap<String, String[]> multitokens; public String multitokens_re; public Numek numek; public Locale locale; public HashSet<String> all_keys; public HashSet<String> repeated_keys; public PhraselistFile ambiguous; public PhraselistFile useless_symbols; }