1)起因:一个触摸屏的软件基本搞定,中间有个模糊查询的功能,就是关键字查询,基本是查询中文,原来想的很简单,只要在系统的输入法上按出软件盘就可以搞定,后来客户反映,因为键很小,很难点上,没有办法,上帝的命令,而且我觉得这个要求还是比较合理的。2)初步设想:画一个“巨大”的软键盘。然后取得每次点击位置就可以知道用户在上面敲的是什么字母了,3)问题:如果用户想打个“我”字出来,在软键盘上敲了个“w”+“o”+空格,我如何能给出智能abc的中文选择呢??或者我的思路就是不正确的,应该用别的什么方法????请牛人指点一二,万分感谢!!!!!!!!!!!!
解决方案 »
- 麻烦大家帮我解决一下DELPHI问题,多谢!
- 用DELPHI自带的Database Desktop工具,查询日期型字段该如何查询
- 谁能告诉我DELPHI的调试技巧或相关文章
- 在函數與過程裡中止其執行用什麼命令?
- 看到大家对我们的真诚的祝福,作为csdn的一员,极是感动!!!(二)(请斑竹手下留情,容我再表示心情)
- vb问题,大家帮忙
- 如何用xml控件?
- 我使用的是dxDBGrid表格,怎样能够用Hint显示一个单元格是完整的数据,当鼠标移到该单元格时发生。
- <<<<<windindance兄请进来取分!!《〈〈〈〈〈〈〈〈〈〈〈<
- CM_MOUSEENTER&&WM_MOUSERENTER
- delphi中如何使用get/set
- 原来Dll是可以传递String的。意外发现!
方法是:1:根据键盘布局或实际需要的放置n个button,用n个button来做每个字母的输入处理。
2:要有个字库;包括 汉子及相应的拼音。
3:通过输入的字母到字库中查询相同拼音的汉子(可以模糊查询)
4:将查询结果显示在一个列表中,然后通过点击列表中的字获得最终的输入汉字。
这个方法比较笨,但是很管用。做起来也不是很难。
根据大力的贴子改成.将大力的两个函数合并成了一个函数.
可以应用于助记码的查询
--*/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fGetPy]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[fGetPy]
GO
--创建取拼音函数
create function fGetPy(@Str varchar(500)='')
returns varchar(500)
as
begin
declare @strlen int,@return varchar(500),@ii int
declare @n int,@c char(1),@chn nchar(1)
select @strlen=len(@str),@return='',@ii=0
set @ii=0
while @ii<@strlen
begin
select @ii=@ii+1,@n=63,@chn=substring(@str,@ii,1)
if @chn>'z'
select @n = @n +1
,@c = case chn when @chn then char(@n) else @c end
from(
select top 27 * from (
select chn = '吖'
union all select '八'
union all select '嚓'
union all select '咑'
union all select '妸'
union all select '发'
union all select '旮'
union all select '铪'
union all select '丌' --because have no 'i'
union all select '丌'
union all select '咔'
union all select '垃'
union all select '嘸'
union all select '拏'
union all select '噢'
union all select '妑'
union all select '七'
union all select '呥'
union all select '仨'
union all select '他'
union all select '屲' --no 'u'
union all select '屲' --no 'v'
union all select '屲'
union all select '夕'
union all select '丫'
union all select '帀'
union all select @chn) as a
order by chn COLLATE Chinese_PRC_CI_AS
) as b
else set @c='a'
set @return=@return+@c
end
return(@return)
end
go
--测试
select dbo.fgetpy('青藏高原') as 东莞市,dbo.fgetpy('ab中c国人') as 中国人
--删除拼音函数
drop function fgetpy
不过哪个朋友做出来真的是一劳永逸的事情,
以后真有朋友做的话,在系统智能abc中有个文件是字库,打开一看就可以发现,做字库的时候不用每个字都自己找直接可以用,
如果没有还没有更好的方法就散分了,谢谢大家!!!!!!!!!!!