/** * Display a small list of Sentences to the caller: */ @GetMapping("/sentence") public @ResponseBody String getSentence() { return "<h3>Some Sentences</h3><br/>" + buildSentence() + "<br/><br/>" + buildSentence() + "<br/><br/>" + buildSentence() + "<br/><br/>" + buildSentence() + "<br/><br/>" + buildSentence() + "<br/><br/>" ; }
/** * Assemble a sentence by gathering random words of each part of speech: */ public String buildSentence() { String sentence = "There was a problem assembling the sentence!"; try{ sentence = String.format("%s %s %s %s %s.", getWord("SUBJECT"), getWord("VERB"), getWord("ARTICLE"), getWord("ADJECTIVE"), getWord("NOUN") ); } catch ( Exception e ) { System.out.println(e); } return sentence; }
/** * Display a small list of Sentences to the caller: */ @GetMapping("/sentence") public @ResponseBody String getSentence() { return "<h3>Some Sentences</h3><br/>" + buildSentence() + "<br/><br/>" + buildSentence() + "<br/><br/>" + buildSentence() + "<br/><br/>" + buildSentence() + "<br/><br/>" + buildSentence() + "<br/><br/>" ; }
/** * Assemble a sentence by gathering random words of each part of speech: */ public String buildSentence() { String sentence = "There was a problem assembling the sentence!"; try{ sentence = String.format("%s %s %s %s %s.", getWord("SUBJECT"), getWord("VERB"), getWord("ARTICLE"), getWord("ADJECTIVE"), getWord("NOUN") ); } catch ( Exception e ) { System.out.println(e); } return sentence; }