@Test public void testIndex() { fail("Not yet implemented"); }
public List<Verbal> index(Analyzer analyzer, String mixedString) { List<Verbal> verbals = new CopyOnWriteArrayList<>(); List<String> nodes = analyzer.parserMixedString(mixedString.toLowerCase()); Iterator<String> it = nodes.iterator(); while(it.hasNext()) { String word = it.next(); Verbal verbal = new Verbal(); if(poscc.containsKey(word)) { verbal.setChinese(word); verbal.setPartOfSpeech(poscc.get(word)); if(cte.containsKey(word)) { verbal.setEnglish(cte.get(word)); if(etc.containsKey(cte.get(word))) { verbal.setExplain(etc.get(cte.get(word))); } }else if(fullcte.containsKey(word)){ verbal.setEnglish(fullcte.get(word)); verbal.setExplain(fullcte.get(word)); } }else if(posee.containsKey(word)) { verbal.setEnglish(word); if(fulletc.containsKey(word)) { verbal.setChinese(fulletc.get(word)); } if(poscc.containsKey(fulletc.get(word))) { verbal.setPartOfSpeech(poscc.get(fulletc.get(word))); } if(etc.containsKey(word)) { verbal.setExplain(etc.get(word)); } }else { verbal.setEnglish(word); verbal.setChinese(fulletc.get(word)); verbal.setPartOfSpeech(StableData.NLP_NULL); verbal.setExplain(StableData.NLP_NULL); } verbals.add(verbal); } return verbals; }
TranslatorImp implements Translator { public List<Verbal> index(Analyzer analyzer, String mixedString) { List<Verbal> verbals = new CopyOnWriteArrayList<>(); List<String> nodes = analyzer.parserMixedString(mixedString.toLowerCase()); Iterator<String> it = nodes.iterator(); while(it.hasNext()) { String word = it.next(); Verbal verbal = new Verbal(); if(poscc.containsKey(word)) { verbal.setChinese(word); verbal.setPartOfSpeech(poscc.get(word)); if(cte.containsKey(word)) { verbal.setEnglish(cte.get(word)); if(etc.containsKey(cte.get(word))) { verbal.setExplain(etc.get(cte.get(word))); } }else if(fullcte.containsKey(word)){ verbal.setEnglish(fullcte.get(word)); verbal.setExplain(fullcte.get(word)); } }else if(posee.containsKey(word)) { verbal.setEnglish(word); if(fulletc.containsKey(word)) { verbal.setChinese(fulletc.get(word)); } if(poscc.containsKey(fulletc.get(word))) { verbal.setPartOfSpeech(poscc.get(fulletc.get(word))); } if(etc.containsKey(word)) { verbal.setExplain(etc.get(word)); } }else { verbal.setEnglish(word); verbal.setChinese(fulletc.get(word)); verbal.setPartOfSpeech(StableData.NLP_NULL); verbal.setExplain(StableData.NLP_NULL); } verbals.add(verbal); } return verbals; } }
TranslatorImp implements Translator { public List<Verbal> index(Analyzer analyzer, String mixedString) { List<Verbal> verbals = new CopyOnWriteArrayList<>(); List<String> nodes = analyzer.parserMixedString(mixedString.toLowerCase()); Iterator<String> it = nodes.iterator(); while(it.hasNext()) { String word = it.next(); Verbal verbal = new Verbal(); if(poscc.containsKey(word)) { verbal.setChinese(word); verbal.setPartOfSpeech(poscc.get(word)); if(cte.containsKey(word)) { verbal.setEnglish(cte.get(word)); if(etc.containsKey(cte.get(word))) { verbal.setExplain(etc.get(cte.get(word))); } }else if(fullcte.containsKey(word)){ verbal.setEnglish(fullcte.get(word)); verbal.setExplain(fullcte.get(word)); } }else if(posee.containsKey(word)) { verbal.setEnglish(word); if(fulletc.containsKey(word)) { verbal.setChinese(fulletc.get(word)); } if(poscc.containsKey(fulletc.get(word))) { verbal.setPartOfSpeech(poscc.get(fulletc.get(word))); } if(etc.containsKey(word)) { verbal.setExplain(etc.get(word)); } }else { verbal.setEnglish(word); verbal.setChinese(fulletc.get(word)); verbal.setPartOfSpeech(StableData.NLP_NULL); verbal.setExplain(StableData.NLP_NULL); } verbals.add(verbal); } return verbals; }  }
TranslatorImp implements Translator { public List<Verbal> index(Analyzer analyzer, String mixedString) { List<Verbal> verbals = new CopyOnWriteArrayList<>(); List<String> nodes = analyzer.parserMixedString(mixedString.toLowerCase()); Iterator<String> it = nodes.iterator(); while(it.hasNext()) { String word = it.next(); Verbal verbal = new Verbal(); if(poscc.containsKey(word)) { verbal.setChinese(word); verbal.setPartOfSpeech(poscc.get(word)); if(cte.containsKey(word)) { verbal.setEnglish(cte.get(word)); if(etc.containsKey(cte.get(word))) { verbal.setExplain(etc.get(cte.get(word))); } }else if(fullcte.containsKey(word)){ verbal.setEnglish(fullcte.get(word)); verbal.setExplain(fullcte.get(word)); } }else if(posee.containsKey(word)) { verbal.setEnglish(word); if(fulletc.containsKey(word)) { verbal.setChinese(fulletc.get(word)); } if(poscc.containsKey(fulletc.get(word))) { verbal.setPartOfSpeech(poscc.get(fulletc.get(word))); } if(etc.containsKey(word)) { verbal.setExplain(etc.get(word)); } }else { verbal.setEnglish(word); verbal.setChinese(fulletc.get(word)); verbal.setPartOfSpeech(StableData.NLP_NULL); verbal.setExplain(StableData.NLP_NULL); } verbals.add(verbal); } return verbals; }  void init(Analyzer analyzer); String EnglishStringToChineseString(Analyzer analyzer, String EnglishString); String ChineseStringToEnglishString(Analyzer analyzer, String ChineseString); String MixedStringToChineseString(Analyzer analyzer, String mixedString); String ChineseStringToEnglishStringWithPOS(Analyzer analyzer, String ChineseString); List<Verbal> index(Analyzer analyzer, String mixedString); List<Verbal> fixPos(List<Verbal> verbals); String getChineseSentenseFromVerbalList(List<Verbal> verbals); String getEnglishSentenseFromVerbalFixList(List<Verbal> verbalsFix); }
TranslatorImp implements Translator { public List<Verbal> index(Analyzer analyzer, String mixedString) { List<Verbal> verbals = new CopyOnWriteArrayList<>(); List<String> nodes = analyzer.parserMixedString(mixedString.toLowerCase()); Iterator<String> it = nodes.iterator(); while(it.hasNext()) { String word = it.next(); Verbal verbal = new Verbal(); if(poscc.containsKey(word)) { verbal.setChinese(word); verbal.setPartOfSpeech(poscc.get(word)); if(cte.containsKey(word)) { verbal.setEnglish(cte.get(word)); if(etc.containsKey(cte.get(word))) { verbal.setExplain(etc.get(cte.get(word))); } }else if(fullcte.containsKey(word)){ verbal.setEnglish(fullcte.get(word)); verbal.setExplain(fullcte.get(word)); } }else if(posee.containsKey(word)) { verbal.setEnglish(word); if(fulletc.containsKey(word)) { verbal.setChinese(fulletc.get(word)); } if(poscc.containsKey(fulletc.get(word))) { verbal.setPartOfSpeech(poscc.get(fulletc.get(word))); } if(etc.containsKey(word)) { verbal.setExplain(etc.get(word)); } }else { verbal.setEnglish(word); verbal.setChinese(fulletc.get(word)); verbal.setPartOfSpeech(StableData.NLP_NULL); verbal.setExplain(StableData.NLP_NULL); } verbals.add(verbal); } return verbals; }  void init(Analyzer analyzer); String EnglishStringToChineseString(Analyzer analyzer, String EnglishString); String ChineseStringToEnglishString(Analyzer analyzer, String ChineseString); String MixedStringToChineseString(Analyzer analyzer, String mixedString); String ChineseStringToEnglishStringWithPOS(Analyzer analyzer, String ChineseString); List<Verbal> index(Analyzer analyzer, String mixedString); List<Verbal> fixPos(List<Verbal> verbals); String getChineseSentenseFromVerbalList(List<Verbal> verbals); String getEnglishSentenseFromVerbalFixList(List<Verbal> verbalsFix); public Map<String, String> poscc; public Map<String, String> posec; public Map<String, String> posee; public Map<String, String> etc; public Map<String, String> cte; public Map<String, String> fulletc; public Map<String, String> fullcte; }