View previous topic :: View next topic |
Author |
Message |
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Feb 17, 2003 3:52 pm Post subject: Downloadable Dictionary |
|
|
For those of you who have wanted to have dictionary capabilities in
Visual DialogScript, this might solve your problems.
I found a downloadable dictionary which is in HTML format, with definitions
in the following format:
Quote: | Progress (n.) A moving or going forward; a proceeding onward; an advance |
It would be nice to be able to transform the files into a format like:
Progress|n.|A moving or going forward; a proceeding onward; an advance
so that it could be easily parsed by VDS.
Right now I have no knowledge on how to transform it , but I think
it could be useful in the furture.
Download page:
http://www.translatum.gr/dictionaries/download-english.htm _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Feb 17, 2003 4:06 pm Post subject: |
|
|
UPDATE: I have found a way to transform the files into plain text and
parsable by VDS. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Feb 17, 2003 5:08 pm Post subject: |
|
|
Here's how to use it with VDS:
Create a VDS script or use a program like WordPad to find and replace
the following strings:
Find: <p><b> Replace with: [nothing]
Find: </p> Replace with: [nothing]
Find: </b> (<I> Replace with: |
Find: </I>) Replace with: |
After you have converted the files to plain-text, rename them to the
letter of the alphabet that corresponds with the first letter of the definitions.
Then you can use the script below or something like it to find the words:
Code: | directory change,@path(%0)
%%target = apple
list create,1
list loadfile,1,a.txt
%x = 0
GOSUB Search
info Word: %%word@cr()Part of Speech: %%pos@cr()Definition: %%def
exit
:Search
repeat
list seek,1,%x
parse "%%word;%%pos;%%def",@item(1)
if @equal(%%word,%%target)
exit
end
%x = @succ(%x)
until @equal(%x, @count(1))
warn Word not in dictionary!
stop |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Tue Feb 18, 2003 6:40 am Post subject: |
|
|
You could've just made a VDS script to parse the html into a text csv.
But nooooo, you had to take the easy way out and use a stupid
text editor for the "Find/Replace" feature! How can you call yourself
a programmer, let alone a VDS Programmer!!!
-Garrett |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Tue Feb 18, 2003 2:41 pm Post subject: |
|
|
I'm too "lazy" to code a script to do it.
No, really, it never even occurred to me to strip the HTML from the
files. I'm not through with converting them, and I think I'll code a script
to do the work for me today. I'm sure it will go a lot faster. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
|