diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-04-11 21:57:48 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-04-11 21:57:48 -0400 |
| commit | 6c307cc6dfb8088281c1432814068f472d0a03d4 (patch) | |
| tree | f1ec11d02d669e44ba800f48345f0c645a097329 /src/main/java/bjc/inflexion/nouns/Prepositions.java | |
| parent | c285b4480963e0ee8b8d32312c6a4c7c94dc2840 (diff) | |
Cleanup
Diffstat (limited to 'src/main/java/bjc/inflexion/nouns/Prepositions.java')
| -rw-r--r-- | src/main/java/bjc/inflexion/nouns/Prepositions.java | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/main/java/bjc/inflexion/nouns/Prepositions.java b/src/main/java/bjc/inflexion/nouns/Prepositions.java index 356aa1c..9f8424e 100644 --- a/src/main/java/bjc/inflexion/nouns/Prepositions.java +++ b/src/main/java/bjc/inflexion/nouns/Prepositions.java @@ -22,12 +22,12 @@ import java.util.Set; /** * List of prepositions. - * + * * @author EVE * */ public class Prepositions { - private Set<String> prepositions; + private final Set<String> prepositions; /** * Create an empty preposition DB. @@ -38,31 +38,33 @@ public class Prepositions { /** * Check if a word is a preposition. - * + * * @param word * The word as a preposition. - * + * * @return Whether or not the word is a preposition. */ - public boolean isPreposition(String word) { + public boolean isPreposition(final String word) { return prepositions.contains(word); } /** * Load the contents of the stream into this DB. - * + * * @param stream * The stream to load from. */ - public void loadFromStream(InputStream stream) { - try(Scanner scn = new Scanner(stream)) { - while(scn.hasNextLine()) { - String ln = scn.nextLine().trim(); + public void loadFromStream(final InputStream stream) { + try (Scanner scn = new Scanner(stream)) { + while (scn.hasNextLine()) { + final String ln = scn.nextLine().trim(); /* * Ignore comments */ - if(ln.startsWith("#")) continue; + if (ln.startsWith("#")) { + continue; + } prepositions.add(ln); } |
