Commits

Lars Yencken committed 8a128bc

[241] Added better error checking of alignment input.

  • Participants
  • Parent commits 3b7057e

Comments (0)

Files changed (1)

     while (getline(iStream, line)) {
         wistringstream wss(line);
         wss >> graphemes >> phonemes;
+        if (graphemes.size() == 0 || phonemes.size() == 0 || 
+                wchar_t(wss.peek()) != EOF) {
+            wcout << L"--> Format error on line " << lineNo << endl;
+            wcout << L"    Expected two space-separated entries: grapheme phoneme" << endl;
+            exit(1);
+        }
         entries.push_back(Segment(wstring(graphemes), wstring(phonemes)));
         lineNo++;
     }