问题描述
大家好,
我应该用什么策略来解决以下问题?我有一个列表
的unicode字符串,我想用它的英语语言比较
''等价。'''
reykjavík (注意i之上的重音)应该与reykjavík相匹配。和
" reykjavik" (相当于英语)。
类似地,德语字母'''''应匹配ss,umlauted a',
o等等应该匹配a,o等。
如何使用c ++ stdlib进行此操作?
非常感谢,
Andrew
Hello all,
What strategy should I use in solving the following problem? I have a list
of unicode strings which I would like to compare with its English language
''equivalent.'' eg
"reykjavík" (note the accent above the i) should match both "reykjavík" and
"reykjavik" (being the English equivalent).
Similarly the German language letter ''?'' should match "ss", umlauted a''s,
o''s etc should match a,o etc.
How would I go about doing this using the c++ stdlib?
Many thanks,
Andrew
推荐答案
你必须实现某种查找表或字典。
虽然STL支持语言环境,但我认为没有办法
比较*不同*语言环境中的两个字符串...特别是对于
Unicode字符串,因为没有Unicode的语言环境 - Unicode
覆盖*所有*区域设置。
此外,有许多单词表示一种语言中的一种(或
语言环境)和其他不同语言的单词,虽然他们是完全相同的
拼写。 "频带"在德语中可能是一个不同的词
而不是band例如,英语。
即使你摆脱了特殊字符,你也必须真正看出
out(例如德语Pr?servative)。和英语防腐剂< g>)。
-
Bob Hairgrove
对于讲德语的英语学生来说最令人费解的一句话
就是这个词:最终。在德语中有一个非常相似的词:eventuell,
这意味着:也许。但最终意味着:终于
-
Karl Heinz Buchegger
这不是一个问题,因为我正在处理的字符串是
地理元素 - 地名等我已经处理了本地化版本
这些(例如Koln和Cologne相当)它基本上只是一个
重音问题。
非常感谢,
Andrew
This won''t really be a problem because the strings I''m dealing with are
geographical elements - placenames etc. I''ve dealt with localised versions
of these (eg Koln and Cologne are equivalent) it''s essentially just a
problem with accents.
Many thanks,
Andrew
这篇关于Unicode字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!