@Test public void testMixedStringToChineseString() { fail("Not yet implemented"); }
public String MixedStringToChineseString(Analyzer analyzer, String mixedString) { List<String> nodes = analyzer.parserMixedString(mixedString.toLowerCase()); StringBuilder sb = new StringBuilder(); Iterator<String> it = nodes.iterator(); while(it.hasNext()) { String temp = it.next(); if(poscc.containsKey(temp)) { sb.append(temp); }else { String[] strings = analyzer.parserEnglishString(temp); for(String string:strings) { if(string == null || string.length() < StableData.INT_ONE) { string = StableData.EMPTY_STRING; } if(etc.containsKey(string)) { sb.append(etc.get(string).split(StableData.NLP_DOT)[StableData.INT_ZERO]); }else if(fulletc.containsKey(string)){ sb.append(fulletc.get(string)); }else { sb.append(temp); } } } } return sb.toString(); }
TranslatorImp implements Translator { public String MixedStringToChineseString(Analyzer analyzer, String mixedString) { List<String> nodes = analyzer.parserMixedString(mixedString.toLowerCase()); StringBuilder sb = new StringBuilder(); Iterator<String> it = nodes.iterator(); while(it.hasNext()) { String temp = it.next(); if(poscc.containsKey(temp)) { sb.append(temp); }else { String[] strings = analyzer.parserEnglishString(temp); for(String string:strings) { if(string == null || string.length() < StableData.INT_ONE) { string = StableData.EMPTY_STRING; } if(etc.containsKey(string)) { sb.append(etc.get(string).split(StableData.NLP_DOT)[StableData.INT_ZERO]); }else if(fulletc.containsKey(string)){ sb.append(fulletc.get(string)); }else { sb.append(temp); } } } } return sb.toString(); } }
TranslatorImp implements Translator { public String MixedStringToChineseString(Analyzer analyzer, String mixedString) { List<String> nodes = analyzer.parserMixedString(mixedString.toLowerCase()); StringBuilder sb = new StringBuilder(); Iterator<String> it = nodes.iterator(); while(it.hasNext()) { String temp = it.next(); if(poscc.containsKey(temp)) { sb.append(temp); }else { String[] strings = analyzer.parserEnglishString(temp); for(String string:strings) { if(string == null || string.length() < StableData.INT_ONE) { string = StableData.EMPTY_STRING; } if(etc.containsKey(string)) { sb.append(etc.get(string).split(StableData.NLP_DOT)[StableData.INT_ZERO]); }else if(fulletc.containsKey(string)){ sb.append(fulletc.get(string)); }else { sb.append(temp); } } } } return sb.toString(); }  }
TranslatorImp implements Translator { public String MixedStringToChineseString(Analyzer analyzer, String mixedString) { List<String> nodes = analyzer.parserMixedString(mixedString.toLowerCase()); StringBuilder sb = new StringBuilder(); Iterator<String> it = nodes.iterator(); while(it.hasNext()) { String temp = it.next(); if(poscc.containsKey(temp)) { sb.append(temp); }else { String[] strings = analyzer.parserEnglishString(temp); for(String string:strings) { if(string == null || string.length() < StableData.INT_ONE) { string = StableData.EMPTY_STRING; } if(etc.containsKey(string)) { sb.append(etc.get(string).split(StableData.NLP_DOT)[StableData.INT_ZERO]); }else if(fulletc.containsKey(string)){ sb.append(fulletc.get(string)); }else { sb.append(temp); } } } } return sb.toString(); }  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 String MixedStringToChineseString(Analyzer analyzer, String mixedString) { List<String> nodes = analyzer.parserMixedString(mixedString.toLowerCase()); StringBuilder sb = new StringBuilder(); Iterator<String> it = nodes.iterator(); while(it.hasNext()) { String temp = it.next(); if(poscc.containsKey(temp)) { sb.append(temp); }else { String[] strings = analyzer.parserEnglishString(temp); for(String string:strings) { if(string == null || string.length() < StableData.INT_ONE) { string = StableData.EMPTY_STRING; } if(etc.containsKey(string)) { sb.append(etc.get(string).split(StableData.NLP_DOT)[StableData.INT_ZERO]); }else if(fulletc.containsKey(string)){ sb.append(fulletc.get(string)); }else { sb.append(temp); } } } } return sb.toString(); }  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; }