自动文本匹配和替换. [英] Auto text match and replace.

查看:128
本文介绍了自动文本匹配和替换.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要创建一个简单的应用程序,在该应用程序中,用户输入单词的缩写,然后自动将其更改为完整的单词.可以在任何应用程序中输入文本,例如MS Word,MS Excel,记事本,电子邮件,博客等.

一个简单的示例:

使用回车键.. tc< space> mw.
System识别空格,逗号或其他任何标点符号,并将其替换为文本..请注意Matthew White.

注意
< space>触发上一个动作
mw -> Matthew White
完全停止会触发先前的操作

基本上,该应用程序将输入的文本与字典(由用户编辑)匹配,然后将单词替换为含义.该程序也可以在任务栏中运行,从而允许用户禁用该功能.

谢谢.. Ginies


~~~

Hi,

I need to create a simple application where a user types in an abbreviation of a word and this is automatically changed into the full word. The text can be entered in any application e.g. MS Word, MS Excel, Notepad, E-mail, Blog, etc.

A simple example:

Use enters.. tc<space>mw.
System recognizes a space, comma or any other punctuation and replaces the text to.. take care Matthew White.

tc -> take care
<space> triggers the previous action
mw -> Matthew White
fullstop triggers the previous action

Basically, the application matches the entered text to a dictionary (edited by user) and replaces the word with the meaning. Also the program can be running in the task bar allowing the user to disable the feature.

Thank you.. Ginies


~~~

推荐答案

使用关键提示tc和价值保重.

Create a hashtable with the key say tc and value take care .

在按下空格和逗号的情况下触发事件.

Fire an event in space pressed and comma pressed . 

创建一个函数String CheckForMatch(字符串为单词)

Create a function String CheckForMatch(String the word) 

如果为true,则读取该行并删除lastLine.Split('');

If true read the line and remove the last element in the result returned by lastLine.Split(' ');

追加返回值.

并在您使用的任何地方进行渲染.

And render where ever you are using it .

希望它能回答您的问题.

Hope it answers your question.


这篇关于自动文本匹配和替换.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆