This allows jmdict to be fed any input and autodetecting the intended
translation direction, similar to Sumatora on Android.
Whether English, Romaji, Kana, or Kanji - it will simply do The Right
Thing To Do(TM):
UTF8 input -> Japanese->English
Non-UTF8 input -> Romaji->English, plus English->Japanese
if (options::source == options::JAPANESE && !isUTF8)
options::source = options::JAPANESE_ROMAJI;
else if (options::source == options::UNKNOWN)
- options::source = isUTF8 ? options::JAPANESE : options::NOT_JAPANESE;
+ // options::source = isUTF8 ? options::JAPANESE : options::NOT_JAPANESE;
+ options::source = isUTF8 ? options::JAPANESE : options::UNKNOWN;
}
int main(int argc, char** argv)
fromJapanese(subject);
else if (options::source == options::JAPANESE_ROMAJI)
fromRomaji(subject);
- else
+ else if (options::source == options::NOT_JAPANESE)
+ toJapanese(subject);
+ else {
+ fromRomaji(subject);
toJapanese(subject);
+ }
cout << entries << " match(es) found." << endl;
return EXIT_SUCCESS;