JavaAlgorithms
Elementary and no so elementary Java algorithms
|
Public Member Functions | |
SentenceRecognize () | |
boolean | isSentence (String sentence) |
Protected Member Functions | |
boolean | isWord (String word) |
Static Protected Attributes | |
static final String | dictionary [] |
This little algorithm is yet another white board interview problem that I ran into at a company named MapR. I can't think of any application for this algorithm. Hopefully it will help you, dear reader.
The MapR recruiter contacted me and got me to interview with MapR. As is the case with so many companies these days, after I took the time to interview with MapR I never heard from them (or the recruiter) again.
Sep 28, 2013
Definition at line 32 of file SentenceRecognize.java.
stringAlgorithms.SentenceRecognize.SentenceRecognize | ( | ) |
Definition at line 39 of file SentenceRecognize.java.
boolean stringAlgorithms.SentenceRecognize.isSentence | ( | String | sentence | ) |
Determine if a sentence, composed of a separator free set of words, is a valid sentence (e.g., entirely composed of words from the dictionary). Some examples are listed below (not all words are valid english words):
sentence | the "sentence" to be tested |
Definition at line 91 of file SentenceRecognize.java.
boolean stringAlgorithms.SentenceRecognize.isWord | ( | String | word | ) | [protected] |
Search for a word in the dictionary
word | the word being searched for |
Definition at line 46 of file SentenceRecognize.java.
final String stringAlgorithms.SentenceRecognize.dictionary[] [static, protected] |
{"a", "an", "at", "attach", "attached", "he", "apple", "are", "area", "arean", "areana", "arm", "charm", "lever", "clever", "drop", "droped", "dope", "doped", "it", "the", "edith", "ball"}
Definition at line 35 of file SentenceRecognize.java.