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; }
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; }