projects
/
jmdict-cli.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
44c6f41
)
Added translation of ー
author
Philipp Reh
<sefi@s-e-f-i.de>
Sat, 1 Aug 2009 13:29:41 +0000
(15:29 +0200)
committer
Philipp Reh
<sefi@s-e-f-i.de>
Sat, 1 Aug 2009 13:29:41 +0000
(15:29 +0200)
kana2romaji.cpp
patch
|
blob
|
history
diff --git
a/kana2romaji.cpp
b/kana2romaji.cpp
index 17c9aea99ba06c3d68ef3167b57356968fe5a75e..646e47c76eed27f507499270f496c5c1bbe83d23 100644
(file)
--- a/
kana2romaji.cpp
+++ b/
kana2romaji.cpp
@@
-331,6
+331,8
@@
void initRomaji() {
romaji["−"] = "-";
romaji["―"] = "-";
romaji[" "] = " ";
romaji["−"] = "-";
romaji["―"] = "-";
romaji[" "] = " ";
+
+ romaji["ー"] = "\3";
}
void remove_quote_1(
}
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)
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;
}
else
rom += trans->second;
@@
-431,4
+433,15
@@
void kana2romaji(const string& kana, string& rom) {
--pos;
}
}
--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];
+ }
}
}