summaryrefslogtreecommitdiff
path: root/kana2romaji.cpp
diff options
context:
space:
mode:
authorPhilipp Reh <sefi@s-e-f-i.de>2009-08-01 15:29:41 +0200
committerPhilipp Reh <sefi@s-e-f-i.de>2009-08-01 15:29:41 +0200
commitc1a24e9dc38e105d8b21ef132f7ec79b9d41f99d (patch)
tree5c701180a6f38e4eb662a369bb3d53d31087a000 /kana2romaji.cpp
parent44c6f41876aa8b79fe436e852233887f3c8700c3 (diff)
Added translation of ー
Diffstat (limited to 'kana2romaji.cpp')
-rw-r--r--kana2romaji.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/kana2romaji.cpp b/kana2romaji.cpp
index 17c9aea..646e47c 100644
--- a/kana2romaji.cpp
+++ b/kana2romaji.cpp
@@ -331,6 +331,8 @@ void initRomaji() {
romaji["−"] = "-";
romaji["―"] = "-";
romaji[" "] = " ";
+
+ romaji["ー"] = "\3";
}
void remove_quote_1(
@@ -359,7 +361,7 @@ void kana2romaji(const string& kana, string& rom) {
if (trans == romaji.end()) {
rom += ch;
if (ch.size() > 1)
- cout << "Don't know how to translate '" << ch << "' in '" << kana << "' to romaji." << endl;
+ cout << "Don't know how to translate '" << ch << "' in '" << kana << "' to romaji.\n";
}
else
rom += trans->second;
@@ -431,4 +433,15 @@ void kana2romaji(const string& kana, string& rom) {
--pos;
}
}
+ else if (rom[pos] == '\3')
+ {
+ if(pos == 0)
+ {
+ cout << "ー is the first letter of a word. Don't know how to translate this.\n";
+ rom.erase(pos);
+ --pos;
+ }
+ else
+ rom[pos] = rom[pos-1];
+ }
}