在android中的字典作为app与eclipse [英] Dictionary in android as app with eclipse

查看:69
本文介绍了在android中的字典作为app与eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用eclipse在android中创建一个应用程序。现在主要的问题是

1.我们无法创建一个应用程序,将您重定向到同一个操作系统中的另一个应用程序,我的意思是,Dictionary应用程序是这样的,我们有一个单词,我们只是点击它,它会将我们重定向到另一个应用程序,如word-web来搜索单词。



2.我想我想做的是,我们的应用程序是这样的,我们必须在该应用程序中打印一些东西,并且它的含义出来了。



3.我们也可以这样点击这个单词并将它重定向到一个网页



我是新的Android应用程序,这些是我的想法,我想知道哪一个是正确的方法。另外,我无法在网上找到任何关于字典的内容,就像我想要的那样。如果有人能告诉我什么是正确的方式来介绍字典应用程序和适当的教程,我会很高兴。



谢谢

I want to make an application in android like dictionary with eclipse . now the main question is that
1. we can not make an app which redirects you to another app in the same OS , what I mean is that Dictionary app is like this , we have a word we just click on it and it redirects us to another app like word-web to search the word .

2. What I think I want to do is that , our app is like this we have to print something in that app and its meaning comes out .

3. also we can do like this click on the word and it redirects you to a webpage

I am new to android app and these are my ideas I wanna know which is the one is right way to do . Also I was unable to find anything on net about dictionary like I want . if anyone can tell me whats the right way to introduce dictionary app and appropriate tutorial for that , it will be a pleasure to me .

Thank you

推荐答案

为什么你认为你的要求会引导你进行有效的字典申请?



我以前碰巧发展我自己的字典软件支持XDXF字典格式( http://xdxf.revdanica.com/drafts/ [ ^ ]),所以我知道这类软件有特定的问题,需要一些特殊的技术来使字典应用程序灵活但提供足够的性能。



大词典的典型字典量为几十兆字节,几百兆字节,这使得加载字典和在字典中搜索成为性能瓶颈。 />


将请求重新指向整个单词会使字典的使用非常有限。字典的用户可能不确定拼写以及我需要同时看到几个相似的单词,就像使用印在纸上的字典时那样。我在输入字符串中键入第一个,第二个和下一个字母,并查看在整个字典中看起来像窗口的最接近的单词列表。当然,此列表是虚拟的,并根据键入的字母即时填充。此外,它需要无限的交叉引用:在控件显示字典文章中点击的每个单词应该在字典中找到具有相同效果的单词 - 最近的键列表。



无论如何,你想要在两个进程中拥有字典功能(UI是一个单独的进程,字典本身可以是一个远程进程),你不能谈论重定向,而是谈论客户端 - 服务器模型,可能是服务通过TCP。应用程序协议应该是有状态的,并记住用户状态以进行上述增量搜索。



现在,关于此类应用程序的服务器部分。在字典中快速搜索的问题导致我设计了一个字典的特殊紧凑二进制表示(我可以选择从XDXF转换)与索引部分。流中的位置由每个键的几个字母索引。字典的大小规定只有索引部分保存在内存中。带有字典的文件保持打开状态,索引机制计算流中的位置以开始读取。这种机制使得搜索的速度(再次,当每个输入或修改的字母更新按键列表的窗口并且选择显示所选按键上的文章时)非常快,人眼无法察觉到延迟。



-SA
Why do you think that your requirements should lead you to effective dictionary application?

I while ago I happened to develop my own dictionary software supporting XDXF dictionary format (http://xdxf.revdanica.com/drafts/[^]), so I know then this class of software has specific problems which need some special techniques to make dictionary application flexible yet providing sufficient performance.

Having a typical dictionary volume of some tens of megabytes and several hundreds of megabytes for big dictionaries makes loading of the dictionary and search in the dictionary a performance bottleneck.

Re-direction of a request as a whole word make the usage of the dictionary very limited. A user of the dictionary may be not sure about spelling and my need to see several similar words at the same time, as it happens when one uses a dictionary printed on paper. I type first, second and next letters in the input string and see the list of the closest words which looks like a "window" in a whole dictionary. Of course, this list is virtual and is populated on the fly depending on typed letters. Also, it needs unlimited cross-references: every word clicked in the control showing dictionary article should find this word in the dictionary with the same effect — list of closest keys.

Anyway, in you want to have dictionary functionality in two processes (UI is a separate process, and the dictionary itself can be a remote process), you cannot talk about "re-direction" but rather about client-server model, presumably served through TCP. The application protocol should be stateful and remember the user status for the purpose of incremental search described above.

Now, about the server part of such application. The problem of quick search in the dictionary led me the the design of special compact binary presentation of a dictionary (I optionally can convert from XDXF) with index section. The positions in the stream are indexed by several few letters of each key. The size of the dictionary dictates that only an index portion is kept in memory. The file with the dictionary is kept open, the indexing mechanism calculates the position in the stream to start reading from. This mechanism make the speed of search (again, when each entered or modified letter updates the window of of list of keys and selection displays the article on the selected key) very fast, with the lag absolutely undetectable by a human eye.

—SA


您需要的所有要求才能获得所有单词然后我们可以根据您的需要执行它
The requirement needed by you can be done before that you need to get all the words and meaning into the db after that we can perform it as per your need


这篇关于在android中的字典作为app与eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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