英式英语到美式英语(反之亦然)转换器
有谁知道将英式英语转换为美式英语的库或代码,反之亦然?
我不认为有太多差异(我想到的一些例子是甜甜圈/甜甜圈、颜色/颜色、灰色/灰色、本地化/本地化),但如果能够提供本地化的网站内容那就太好了。
Does anyone know of a library or bit of code that converts British English to American English and vice versa?
I don't imagine there's too many differences (some examples that come to mind are doughnut/donut, colour/color, grey/gray, localised/localized) but it would be nice to be able to provide localised site content.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
英国英语和美国英语之间的差异远远大于拼写差异。 还有引擎盖/帽子、人行道/人行道、裤子/长裤的想法。
猜猜这取决于你需要走多远。
The difference between UK and US English is far greater than just a difference in spelling. There is also the hood/bonnet, sidewalk/pavement, pants/trousers idea.
Guess it depends how far you need to take it.
我一直在寻找解决方案,但始终找不到,因此,我使用了 varcon 项目和语言专家免费提供的约 20,000 种不同拼写的主列表,为其编写了自己的代码。在wordsworldwide:
https://github.com/HoldOffHunger/convert-british-to -american-spellings
因为我有两个源列表,所以我用它们相互交叉检查,我发现了许多错误和拼写错误(varcon 列出了“preexistent”的英国等效项“preaexistent”)。 我也可能不小心犯了拼写错误,但是,由于我在这里没有做任何文字处理,所以我不相信情况是这样。
例子:
I looked forever to find a solution to this, but couldn't find one, so, I wrote my own bit of code for it, using a master list of ~20,000 different spellings that were freely available from the varcon project and the language experts at wordsworldwide:
https://github.com/HoldOffHunger/convert-british-to-american-spellings
Since I had two source lists, I used them each to crosscheck each other, and I found numerous errors and typos (varcon lists "preexistent"'s british equivalent as "preaexistent"). It is possible that I may have accidentally made typos, too, but, since I didn't do any wordsmithing here, I don't believe that to be the case.
Example:
我认为如果您正在考虑从美式英语转换为英式英语,我个人不会打扰。 无论如何,英国已经非常美国化了,我们接受网上愚蠢的猛拉拼写:)
I think if you're thinking of converting from American English to British English, I personally wouldn't bother. Britain is very Americanised anyway, we accept silly yank spellings on the net :)
我最近也遇到了类似的问题。 我发现了以下工具,名为 VarCon。 我还没有测试过它,但我需要一个粗略的转换器来处理一些文本数据。 这是一个例子。
看起来它适用于各种方言。 请务必阅读自述文件并谨慎操作。
*注意:这只会纠正拼写变化。
I had a similar problem recently. I discovered the following tool, called VarCon. I haven't tested it out, but I needed a rough converter for some text data. Here's an example.
It looks like it works for various dialects. Be sure to read the README and proceed with caution.
*note: This will only correct spelling variations.
我一直在致力于将美国英语转换为英国英语。 正如我发现的那样,编写一些东西来以另一种方式进行转换实际上要困难得多,但我希望有一天能够提供反向转换。
这并不完美,但也算不错的努力(即使我自己也这么说)。 它将大多数美国拼写转换为英国拼写,但有些单词英国英语保留美国拼写(例如“程序”,指的是计算机软件)。 它不会将诸如裤子之类的单词转换为裤子,因为我的主要目标只是使整个文档的拼写统一。
还有诸如“practice”和“license”之类的词,英国英语使用这些词或“practice & license”。 许可证,取决于该词是用作动词还是名词。 对于这两个示例,转换工具将突出显示它们,并且当您将鼠标悬停在它们上方时,屏幕左下角会弹出说明性注释。 所有转换的单词模式都带有红色下划线,并且输出与原始输入并排比较。
它会很快地处理相当大的文本块,但我更喜欢一次只使用它几个段落 - 从 Word 文档中复制它们。
它仍然是一项正在进行的工作,因此如果有人有任何意见或建议,我将不胜感激,我可以使用反馈来改进它。
http://www.us2uk.eu/
I've been working on one to convert US English to UK English. As I've discovered it's actually a lot harder to write something to convert the other way but I hope to get around to providing a reverse conversion one day.
This isn't perfect, but it's not a bad effort (even if I do say so myself). It'll convert most US spellings to UK ones but there are some words where UK English retains the US spelling (e.g. "program" where this refers to computer software). It won't convert words like pants to trousers because my main goal was simply to make the spelling uniform across the whole document.
There are also words such as practice and license where UK English uses either those or practise & licence, depending on whether the word's being used as a verb or a noun. For those two examples the conversion tool will highlight them and an explanatory note pops up on the lower left hand of your screen when you hover your mouse over them. All word patterns which are converted are underlined in red, and the output is shown in a side by side comparison with your original input.
It'll do quite large blocks of text quite quickly, but I prefer to go use it just for a couple of paragraphs at a time - copying them in from a Word doc.
It's still a work in progress so if anyone has any comments or suggestions then I'd appreciate feedback I can use to improve it.
http://www.us2uk.eu/