add solution for hw4:3435
This commit is contained in:
@@ -43,6 +43,21 @@ public class WordStatLengthSuffix {
|
|||||||
data = r.read();
|
data = r.read();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (sb.length() > 0) {
|
||||||
|
String word = sb.toString().toLowerCase();
|
||||||
|
if (word.length() != 1) {
|
||||||
|
word = word.substring(word.length() / 2);
|
||||||
|
if (wordMap.containsKey(word)) {
|
||||||
|
wordMap.get(word).count++;
|
||||||
|
} else {
|
||||||
|
wordMap.put(word, new WordInfo(word, 1, wordIndex));
|
||||||
|
wordIndex++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (sb.length() > 0) {
|
if (sb.length() > 0) {
|
||||||
String word = sb.toString().toLowerCase();
|
String word = sb.toString().toLowerCase();
|
||||||
if (wordMap.containsKey(word)) {
|
if (wordMap.containsKey(word)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user