@ RequestMapping ( produces = MediaType . APPLICATION_JSON_VALUE , value = "/parse" , method = RequestMethod . GET ) public String parse ( @ RequestParam ( "sentence" ) String sentence , HttpServletRequest request ) { if ( sentence == null || sentence . trim ( ) . isEmpty ( ) ) { return StringUtils . EMPTY ; } sentence = sentence . trim ( ) ; LOGGER . info ( "Parse [" + sentence + "]" ) ; DTree tree = PARSER . parse ( sentence ) ; DTreeEntity parseTreeEntity = new DTreeEntity ( tree , "SAMPLE_AUTHOR" ) ; dNodeEntityRepository . save ( parseTreeEntity . dNodeEntities ) ; dTreeEntityRepository . save ( parseTreeEntity ) ; return "[" + toJSON ( tree . get ( 0 ) ) + "]" ; }
Parse sentence .