Пример #1
0
 public static void main(String args[]) throws IOException {
   MyIn in = new MyIn();
   Spelling spelling = Spelling.getInstance();
   while (in.hasNextLine()) {
     System.out.println(spelling.correct(in.nextLine()));
   }
 }
Пример #2
0
 public Spelling(MyIn in) throws IOException {
   while (in.hasNextLine()) {
     String[] split = in.nextLine().split("\t");
     nWords.put(split[0], Double.parseDouble(split[1]));
   }
 }