Thanks for the quick attention! And for a great program.
On Mar 7, 9:36 pm, Blair McBride <[email protected]> wrote:
> Thanks - just fixed this. There should be a new version out with the fix
> sometime early this week.
>
> - Blair
>
> On 7/03/2009 8:22 AM, The Vu wrote:
>
> > I got the same problem on Windows.
>
> > When I look at the code for "define" have found out the reason. Here
> > are the code:
>
> > function defineWord(word, callback) {
> > var url
> > ="http://services.aonaware.com/DictService/DictService.asmx/DefineInDict";
>
> > var params = Utils.paramsToString({
> > dictId:"wn", //wn: WordNet, gcide: Collaborative Dictionary
> > word: word
> > });
>
> > Utils.ajaxGet(url + params, function(xml) {
> > var text = jQuery(xml).find("WordDefinition").text();
>
> > callback(text);
> > });
> > }
>
> > CmdUtils.CreateCommand({
> > name:"def",
> > description:"Gives the meaning of a word.",
> > help:"Try issuing"define aglet"",
>
> > icon:"http://www.answers.com/favicon.ico",
> > takes: {"word": noun_arb_text},
> > execute: function( directObj ) {
> > var word = directObj.text;
>
> > Utils.openUrlInBrowser("http://www.answers.com/" + escape(word) );
> > },
> > preview: function( pblock, directObj ) {
> > var word = directObj.text;
> > if (word.length< 2)
>
> > pblock.innerHTML ="Gives the definition of a word.";
> > else {
> > pblock.innerHTML ="Gives the definition of the word" + word +".";
> > defineWord( word, function(text){
>
> > text = text.replace(/(\d+:)/g,"<br/><b>$&</b>");
> > text = text.replace(/(1:)/g,"<br/>$&");
> > text = text.replace(word,"<span
> > style='font-size:18px;'>$&</span>");
>
> > text = text.replace(/\[[^\]]*\]/g,"");
> > pblock.innerHTML = text;
> > });
> > }
> > }
>
> > So define uses the service from aonaware. Given the dictionary id (there
> > are different dictionaries there and define use WordNet dictionary) and
> > the word it will return the xml with the definition of the word. For
> > example if dictionary id is wn (for WordNet) and the word id hello, the
> > XML returned is:
>
> > <WordDefinition>
> > <Word>hello</Word>
> > <Definitions>
> > <Definition>
> > <Word>hello</Word>
> > <Dictionary>
> > <Id>wn</Id>
> > <Name>WordNet (r) 2.0</Name>
> > </Dictionary>
> > <WordDefinition>
> > hello n : an expression of greeting; "every morning they exchanged
> > polite hellos" [syn: {hullo}, {hi}, {howdy}, {how-do-you-do}]
> > </WordDefinition>
> > </Definition>
> > </Definitions>
> > </WordDefinition>
>
> > So define looks up in this xml file for the definition:
>
> > var text = jQuery(xml).find("WordDefinition").text()
>
> > However, the problem is that there are 2 tags for WordDefinition, the
> > innner WordDefintion contains the definition of the word and the outer
> > WordDefinition includes the inner one. Hence, the above lookup will
> > return duplicate result.
>
> > I copied the code and change "WordDefinition" to "Definition" and create
> > a new command def to try out. The duplicate in the preview was gone.
>
> > Best regards
> > Tony Vu
>
> > On Sat, Mar 7, 2009 at 1:07 AM, wastvedt <[email protected]
> > <mailto:[email protected]>> wrote:
>
> > Anytime I look up a word with the built-in "define" command, I get two
> > successive copies of the dictionary definition.
> > I'm running Firefox 3.0.6 on Ubuntu 8.10, with Ubiquity 0.1.6.1.
> > Is this a bug? Or is there something I should do differently? Let me
> > know if you need more info.
>
> > For example, typing "define ubiquity" displays
>
> > ubiquity ubiquity wn WordNet (r) 2.0 ubiquity n : the state of being
> > everywhere at once (or seeming to be everywhere at once) ubiquity n :
> > the state of being everywhere at once (or seeming to be everywhere at
> > once)
>
> > Thanks for the help.
> > -Trygve
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---