コード例 #1
0
 private String segmentForIdeaBoardy(String sentence, Map<String, String> params)
     throws IOException {
   String result;
   List<Map> array = PojoMapper.fromJson(sentence, List.class);
   for (Map obj : array) {
     String content = (String) obj.get("content");
     List<WordDto> words = segmentService.segment(content, params);
     obj.put("segmentResult", words);
   }
   result = PojoMapper.toJson(array);
   return result;
 }
コード例 #2
0
 private String segmentSentence(String sentence, Map<String, String> params) throws IOException {
   String result;
   List<WordDto> words = segmentService.segment(sentence, params);
   result = PojoMapper.toJson(words);
   return result;
 }