- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要按姓名搜索人员。这里的人名可以是英文、韩文或中文。为此,我使用了 Like
搜索条件 Name
如下:
select * from [MyTable] where Name like N'%t%'
t
的用户.但这不适用于韩语或中文。就像我用韩文字母搜索
ㅈ
那么它应该给出包含这个字母的所有名称,如
**정수연, 재훈아이팟, 정원혁 테스트 7**
.我尝试了以下方法,但结果为零
select * from [MyTable] where Name like N'%ㅈ%' - No Results
select PATINDEX(N'%ㅈ%',N'정수연(Mohan)') - giving value as ZERO
select Charindex(N'ㅈ',N'정수연') - giving value as ZERO
public static string DecomposeSyllabels(string unicodeString) {
try {
//Consonant consonant only used
string[] JLT = { "ㄱ", "ㄲ", "ㄴ", "ㄷ", "ㄸ", "ㄹ", "ㅁ", "ㅂ", "ㅃ", "ㅅ", "ㅆ", "ㅇ", "ㅈ", "ㅉ", "ㅊ", "ㅋ", "ㅌ", "ㅍ", "ㅎ" };
// Only used a collection of neutral
string[] JVT = { "ㅏ", "ㅐ", "ㅑ", "ㅒ", "ㅓ", "ㅔ", "ㅕ", "ㅖ", "ㅗ", "ㅘ", "ㅙ", "ㅚ", "ㅛ", "ㅜ", "ㅝ", "ㅞ", "ㅟ", "ㅠ", "ㅡ", "ㅢ", "ㅣ" };
// Initial and coda consonants used in
string[] JTT = { "", "ㄱ", "ㄲ", "ㄳ", "ㄴ", "ㄵ", "ㄶ", "ㄷ", "ㄹ", "ㄺ", "ㄻ", "ㄼ", "ㄽ", "ㄾ", "ㄿ", "ㅀ", "ㅁ", "ㅂ", "ㅄ", "ㅅ", "ㅆ", "ㅇ", "ㅈ", "ㅊ", "ㅋ", "ㅌ", "ㅍ", "ㅎ" };
double SBase = 0xAC00;
long SCount = 11172;
int TCount = 28;
int NCount = 588;
string syllables = string.Empty;
foreach (char c in unicodeString) {
double SIndex = (int)c - SBase;
if (0 > SIndex || SIndex >= SCount) {
syllables = syllables + c;
continue;
}
int LIndex = (int)Math.Floor(SIndex / NCount);
int VIndex = (int)(Math.Floor((SIndex % NCount) / TCount));
int TIndex = (int)(SIndex % TCount);
syllables = syllables + (JLT[LIndex] + JVT[VIndex] + JTT[TIndex]);
}
return syllables;
}
catch {
return unicodeString;
}
}
最佳答案
您必须分解韩语音节并将它们存储到 SQL 数据库中的单独列中(如 ㅈㅓㅇㅅㅜㅇㅕㄴ 表示 정수연)。我建议您编写一个小型自定义应用程序来解析您的数据库,分解所有韩语音节,并将结果保存到单独的列中。
编辑
下面是一些可以分解韩文音节的 Python 代码:
#!/usr/local/bin/python
# -*- coding: utf8 -*-
import codecs, sys, os, math
JLT="ㄱ,ㄲ,ㄴ,ㄷ,ㄸ,ㄹ,ㅁ,ㅂ,ㅃ,ㅅ,ㅆ,ㅇ,ㅈ,ㅉ,ㅊ,ㅋ,ㅌ,ㅍ,ㅎ".split(",")
JTT=",ㄱ,ㄲ,ㄱㅅ,ㄴ,ㄴㅈ,ㄴㅎ,ㄷ,ㄹ,ㄹㄱ,ㄹㅁ,ㄹㅂ,ㄹㅅ,ㄹㅌ,ㄹㅍ,ㄹㅎ,ㅁ,ㅂ,ㅂㅅ,ㅅ,ㅆ,ㅇ,ㅈ,ㅊ,ㅋ,ㅌ,ㅍ,ㅎ".split(",")
JVT="ㅏ,ㅐ,ㅑ,ㅒ,ㅓ,ㅔ,ㅕ,ㅖ,ㅗ,ㅘ,ㅙ,ㅚ,ㅛ,ㅜ,ㅝ,ㅞ,ㅟ,ㅠ,ㅡ,ㅢ,ㅣ".split(",")
SBase=0xAC00
SCount=11172
TCount=28
NCount=588
def HangulName(a):
b=a.decode('utf8')
sound=''
for i in b:
cp=ord(i)
SIndex = cp - SBase
if (0 > SIndex or SIndex >= SCount):
# "Not a Hangul Syllable"
pass
LIndex = int(math.floor(SIndex / NCount))
VIndex = int(math.floor((SIndex % NCount) / TCount))
TIndex = int(SIndex % TCount)
sound=sound+(JLT[LIndex] + JVT[VIndex] + JTT[TIndex]).lower()
return sound
print HangulName("정수연")
dda$ python test.py
ㅈㅓㅇㅅㅜㅇㅕㄴ
关于sql-server - 在 SQL Server 中的韩语单词(任何 Unicode 单词)中查找韩语字母(任何 Unicode 字符)的索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12579977/
有人可以为韩语、印尼语、泰语和越南语推荐一个开源的 POS 标记器吗? 我可以用它来标记我目前拥有的语料库数据。 (例如 the stanford-postagger ) 如果您是开发人员并且愿意分享
我正在尝试在同一个文件中写出英语、日语和韩语。 这是我的做法: new File("genned/test123.txt").write("안녕하세요 hello こんにち", "utf8") 生成的
许多日语字体都有标准 ASCII 拉丁字符的特殊固定宽度变体,其宽度是字体的汉字/假名字符标准固定宽度的一半。这样,您只需为每个日语字符使用 2 个拉丁字符即可垂直排列拉丁语和日语文本。这被称为“半角
问题是我们是否有一个段落同时包含韩语(韩语)字符和罗马字符。 CSS 中有没有办法让韩文字符使用某种字体,而罗马字符使用另一种字体? 例如,我想对韩文使用 Noto Sans KR,对罗马字符使用 H
我正在尝试验证用户输入(在 Python 中)并查看是否使用了正确的语言,在本例中为韩语。让我们用韩语单词表示电子邮件地址:이메일 주소 我可以像这样检查每个字符: import unicodedat
我正在用 C 语言制作一个网络服务器。我需要从 url 获取参数以进行计算。问题是人们可以在一个字段(名称)中键入 unicode 字符。然而,当我的服务器收到那个请求时,这些 unicode 字
此前ios最新版微信有边写边译功能,输入的对话可以自动翻译成英语、韩语、日语等多种语言,不少安卓用户羡慕不已!不过就在昨天微信安卓8.0.18内测版的推出新增了边写边译功能,安卓的小伙伴们也终于可以
我在Windows 10中使用了Sublime Text 3。 从上面的截图中可以看到,韩文/中文/日文字符在“转到任何内容”文本输入,侧边栏和选项卡标题中均被打断。 有谁知道如何解决这个问题?我认为
我尝试在 python 中读取一些以“euc-kr”编码的韩语文本文件,但出现了一些错误。在检查 encodings 模块一段时间后,我了解到该模块以看似非常奇怪的方式对韩语字符进行编码。我举个例子
我正在尝试对 Hangul(韩语字符)进行颜色编码。每个“ block ”都会创建一个韩语音节。 Hangul 被分解为 Jamo(类似于英语中的字母)。当您键入韩语中的 jamo/字母时,它们通常会
我需要在包含标题的 2.000.000 个数据库行中进行搜索,例如歌曲。我需要一个能够快速提供结果、适用于 iOS 平台并支持 unicode 字符集的解决方案。我正在考虑使用 sqlite 的 FT
当我尝试通过 CkFtp2.java 客户端使用日语/韩语/阿拉伯语用户名/密码登录 FTP 服务器时,失败并显示消息“530 请先使用 USER 和 PASS 登录”。当我使用英文用户名/密码时,一
我遇到了 JPasswordField 组件尝试使用亚洲复合字符的不一致行为的问题。 我的代码是: final JCheckBox visiblePassword = new JCheckBo
我正在开发一个 vue 项目,这是一个小错误的修复。但这让我很难受。 我制作了 v-text-field 仅输入数字,看起来效果很好。 我只想输入数字,因此我使用 keydown 事件来使用 Pre
我是一名优秀的程序员,十分优秀!