AutoHotkey Community

It is currently May 26th, 2012, 10:56 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: August 24th, 2005, 5:03 pm 
Offline

Joined: February 16th, 2005, 5:32 pm
Posts: 44
Do you know any good alternative to Babylon? I like WordWeb a lot, but you cannot build your own dictionaries easily or at least download them. Well, you can however buy WordWeb Developer, but there seems to be no community, so you have to make all dictionaries yourself...

Is there a freeware or even open source software that fills this gap? I've tested jDictionary, but it seems not very active (last version from 2002) and you can't make your own dictionaries either. Being able to make your own dictionaries is an important feature for me, since if it's not English, Spanish, French or German it get's hard to find something good.

Well, thinking again: What do you think of making a dictionary software with AHK? It could/should be modeled upon WordWeb. The first dictionary could be the AHK help file. :wink: Above all it must be light-weight and small. I don't like dictionaries that clutter the whole screen and takes ages to launch. Do you think it will be any good? I would try it, but maybe AHK is not the right choice for something?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2005, 5:12 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
The problem is to get the database.
Interfaces to the users can be done in nearly all languages. But with AHK it is easy.
If you can get a translation with URLDownloadToFile from WordWeb, it should be pretty easy.

Have a look at
http://www.autohotkey.com/forum/viewtopic.php?t=44

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2005, 5:15 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Or have a look at this:
Code:
URLDownloadToFile, http://pda.leo.org/?search=%clipboard%, LEOutput.txt
Found := False
Line =
Loop, Read, LEOutput.txt
  {
    IfInString, A_LoopReadLine, Unmittelbare Treffer
      {
       Line = %Line%%A_Tab%%A_LoopReadLine%
       Found := True
      }
    Else IfInString, A_LoopReadLine, Verben und Verbzusammensetzungen
      {
       Line = %Line%%A_Tab%%A_LoopReadLine%
       Found := True
      }
    Else IfInString, A_LoopReadLine, lieferte keine Treffer
      {
        MsgBox, Leo lieferte keine Ergebnisse
        Found := False
        break
      }
  }
FileDelete, LEOutput.txt

If Found
  {
    StringReplace, Line, Line, %A_Tab%,, All
    StringReplace, Line, Line,  ,, All
    StringReplace, Line, Line, Forumsdiskussion,, All
    StringReplace, Line, Line, ENGLISCH,, All
    StringReplace, Line, Line, DEUTSCH,, All
    StringReplace, Line, Line, .gif"></a></td, , All
    StringReplace, Line, Line, </tr>,`n, All
    StringReplace, Line, Line, </td>, %A_Tab%, All
    Loop
      {
        StringReplace, Line, Line, %A_space%%A_space%,%A_space%, All
        StringReplace, Line, Line, %A_space%`n,`n, All
        StringReplace, Line, Line, `n%A_space%,`n, All
        StringReplace, Line, Line, %A_Tab%`n,`n, All
        StringReplace, Line, Line, `n%A_Tab%,`n, All
        StringReplace, Line, Line, `n`n,`n, All
        StringGetPos, FirstPos, Line, <
        If ErrorLevel
            break
        StringGetPos, SecondPos, Line, >
        StringLen, Length, Line
        StringLeft, LineFront, Line, %FirstPos%
        StringRight, LineBack, Line, % Length - SecondPos - 1   ;%
        Line = %LineFront% %LineBack%
      }

    Text =
    Loop, Parse, Line , `n
       If A_LoopField is space
           Text = %Text%
       Else IfInString, A_LoopField , %A_Tab%
           Text = %Text%`n%A_LoopField%
       Else IfInString, A_LoopField , Link zu
           Text = %Text%
       Else
           Text = %Text%`n`n  %A_LoopField%`n

    MsgBox, Die Übersetzung gemäß LEO: %Text%
  }
Else
    MsgBox, Habe nichts in der Datei Leo gefunden,`nevtl. muss mein Admin die Suche in der Datei verfeinern.


_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2005, 5:37 pm 
Offline

Joined: February 16th, 2005, 5:32 pm
Posts: 44
Yup, I thought about something like a "front end", too. That could be a component.

The database can be built by hand. It will never be as big as a "true" dictionary if you do it alone but in exchange it has the words you need. A good English dictionary is nice, but if you look for a technical or very special term or a word from another language it quickly get's useless. Long ago I used Babylon (I think it was still freeware then :lol: ) and there were tons of dictionaries by users. Some only as big as hundred words or even smaller, but since you could look them up simutaneoulsy it was useful.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2005, 8:33 pm 
Offline

Joined: August 26th, 2004, 3:11 pm
Posts: 80
Location: Chelsea - MA, USA
It would be more interesting doing a script for AHK that does this than making use of other programs. AHK has lots of mouse and control text capturing scripts already. And besides, it could even be better than Babylon, depending on the way it's implemented. For example, it could be nice to have an option to see the meaning of a word just by hovering it.

Of course, this it would be quite an effort... creating lots of dictionaries and GUI and etc... You see that Babylon passed through 5 major versions already.

_________________
Working now on:
NumpadMouse v2 (Draw)
top-recode project (private server script) (pkodev)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 25th, 2005, 3:22 pm 
Offline

Joined: February 16th, 2005, 5:32 pm
Posts: 44
I tried something quick here: Tool Tip Dictionary. It's not what I actually wanted since it bears no resemblance to WordWeb but in fact I use this more often than WordWeb. :wink:

Deguix, is it yet possible to capture the text under the mouse pointer? I thought this was something for next AHK versions?

Capturing from other web sites is a nice thing but still does not help me too much. Actually I'm looking for a portuguese dictionary. The site which I use for my Tool Tip Dic has one but it's not particulary bright. It knows corrigir (infinitive) but not corrijo (inflected), so it's not of much use if you're weak at irregular verbs. However, I've found a portuguese-portuguese dictionary which knows irregular verbs, but does not translate... but maybe I can use a script to bind both together. Hm... but accessing several websites might slow a script, so maybe I can build an offline repository for words already looked up. But still there are words that cannot be found, that's why I think an option to manually add words is essential. But maybe I can skip this if you bind together all portuguese dictionaries? :D

Well, anyhow, I'm just thinking. Next thing: What about small dictionaries? Imaginge one that shows the AHK commands (maybe just the prototype so that you know how much variables you need and where to put each) Just building it up along with your programming might be more efficient than first writing a script which extracts the info from the website.

Writing an extracting script always is a new task. It's hardly possible to use old scripts for this. But if you have a script (or template) to build dictionaries you have something you can always use. And especially if you bind together dictionaries from other users it can be faster than extracting websites. That's something that makes wikipedia so effective.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 26th, 2005, 12:18 am 
Offline

Joined: August 26th, 2004, 3:11 pm
Posts: 80
Location: Chelsea - MA, USA
My primary language is Portuguese.

Quote:
Deguix, is it yet possible to capture the text under the mouse pointer? I thought this was something for next AHK versions?

Hmmm... It will be difficult to do this, but I might have an idea of using it with C++ API (I have no experience on doing this, this is just my hypothesis):

1) Detect the text and the control rectangle coordinates below the cursor.
1.A) Detect the window behind the point. (ChildWndFromPoint)
1.B) Get the control's text (SendMessage with WM_GETTEXT generally). If the control doesn't have text, then don't continue.
1.C) Get the control's coordinates (GetWindowRect).
2) Get the control's DC (GetDC).
3) Calculate the characters positions. (GetCharacterPlacement)
4) Compare the current mouse position with all the characters positions.
5) If one of them matches, assign the character position to its respective character value.
6) Detect which word was selected: If the word has a space before or after it, then get the text between those. If the word has punctuation in the end or start, like a period or a colon, then ignore the character and detect the word found. (can be changed to support entire sentences) This depends on the language.

Now the rest is just extra stuff, like drawing a rectangle around the selected text. You can do this like this:
1) Detect the inverse colors for the text and background. Just do 0xFFFFFF - color. (GetBkColor and GetTextColor)
2) Detect the rectangle of the text. Just detect the differences of position between the start and end characters. If the word is split to the next line, then two rectangles will be needed to detect.
3) Draw the selected text with inverse colors. (ExtTextOut)

_________________
Working now on:
NumpadMouse v2 (Draw)
top-recode project (private server script) (pkodev)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 26th, 2005, 6:15 pm 
Offline

Joined: December 15th, 2004, 10:24 pm
Posts: 303
Location: United States
one of many gems waiting to be found in the forum...
credit goes to corrupt for sharing this one

Get Word Under Mouse (DLL)

_________________
1) The Open Source Definition http://www.opensource.org/docs/definition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <<AutoHotkey>>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2005, 6:08 pm 
Offline

Joined: August 26th, 2004, 3:11 pm
Posts: 80
Location: Chelsea - MA, USA
Sweet. With this, we now just need a dictionary and a GUI.

The Tool Tip Dictionary script uses lookwayup.com dictionaries, but if a GUI is created, then it'll be easy to implement wiktionary based script. There is always dump files which to search words from. But there is more, it would be even better to actually change a word definition from the GUI. My skills in the pywikipedia bot could be in help to make things easier for you to edit pages directly from the GUI itself.

This would be perfect! You would be able to edit wiktionary pages directly from AHK itself! :D

_________________
Working now on:
NumpadMouse v2 (Draw)
top-recode project (private server script) (pkodev)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2005, 11:08 am 
Offline

Joined: July 26th, 2004, 9:07 pm
Posts: 62
Could be useful kbabel?
http://freshmeat.net/projects/kbabel/

Open Source ,it is used under KDE in order translate interfaces and handbook.
There are many database and dictionaries to disposition.

_________________
Loriss


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Proper Language programs
PostPosted: March 31st, 2010, 7:18 pm 
If it is Spanish you want, get Word Magic 5.2 from underground sites. :D [/b]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 1st, 2010, 3:41 am 
Offline

Joined: March 20th, 2010, 9:49 am
Posts: 224
how about StarDict

have a look at the documentation and see if your build up your custom dict


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 1st, 2010, 3:48 am 
Offline

Joined: March 20th, 2010, 9:49 am
Posts: 224
here's the page docs for making a custom dict

http://stardict.sourceforge.net/StarDictFileFormat


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 1st, 2010, 5:02 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
I asked my friend if I could use his dictaphone, he said "NO! You use your finger like everybody else!"

Image

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2010, 4:47 pm 
Offline

Joined: March 20th, 2010, 9:49 am
Posts: 224
have u tried stardict


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: nimda and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group