How to get and use a dictionary
How to get and use a dictionary
I am writing a Wordament Clone ,just for the hell of it. So far so good. My operating system is Windows 10.
So far, all my code is in freebasic - (no libraries)
I would like to know how to access a dictionary in order to check if a word exists, as in scrabble.
Any help would be greatly appreciated.
Thanks
So far, all my code is in freebasic - (no libraries)
I would like to know how to access a dictionary in order to check if a word exists, as in scrabble.
Any help would be greatly appreciated.
Thanks
Re: How to get and use a dictionary
Well, it depends lagely on what you understand, when stating 'dictionary'.
Can you give something closer to a Data-Structure, which defines it better?
E.g. Array of String, or similar ...
Alternative: post your code (what you have, so far) here, to give us some
ideas, of what you are attempting.
Btw. I'm not familiar, with what you are referring to: 'Wordament'.
Can you give something closer to a Data-Structure, which defines it better?
E.g. Array of String, or similar ...
Alternative: post your code (what you have, so far) here, to give us some
ideas, of what you are attempting.
Btw. I'm not familiar, with what you are referring to: 'Wordament'.
Last edited by MrSwiss on Jun 01, 2019 18:49, edited 1 time in total.
Re: How to get and use a dictionary
Thanks for your quick response Mr. Swiss.
Wordament is a Microsoft game in which you make words from the letters you have.
The word is a string of variable length made up from the 26 uppercase letters.
Once the word is made I would like to check to see if it is a legitimate English word.
I thought the best way of checking this is through some dictionary. I have no idea where in windows I can access a dictionary and use it to check if the word exists.
Paul22
Wordament is a Microsoft game in which you make words from the letters you have.
The word is a string of variable length made up from the 26 uppercase letters.
Once the word is made I would like to check to see if it is a legitimate English word.
I thought the best way of checking this is through some dictionary. I have no idea where in windows I can access a dictionary and use it to check if the word exists.
Paul22
Re: How to get and use a dictionary
Maybe this will help you: viewtopic.php?f=7&t=26646
Re: How to get and use a dictionary
OK, first things, first "currently no dictionary", which sort of means, it's up
for debate "how to implement" it.
Second "where to get one"? I think the best chances are from a Word-
Processing-Application but again "is there one, on the system installed?".
(beware of copyright infringement, on this score!)
Alternative:
1) create one yourself (you're in, for a lot of work!)
2) maybe one or more can be found, on the internet?
just some ideas, so far ...
for debate "how to implement" it.
Second "where to get one"? I think the best chances are from a Word-
Processing-Application but again "is there one, on the system installed?".
(beware of copyright infringement, on this score!)
Alternative:
1) create one yourself (you're in, for a lot of work!)
2) maybe one or more can be found, on the internet?
just some ideas, so far ...
Not helpful at all (it's about something different).UEZ wrote:Maybe this will help you: viewtopic.php?f=7&t=26646
Re: How to get and use a dictionary
Instr is fast enough I think.
https://www.mediafire.com/file/w1w17bhl ... y.zip/file
https://www.mediafire.com/file/w1w17bhl ... y.zip/file
Re: How to get and use a dictionary
For my tetris game (https://freebasic.net/forum/viewtopic.p ... 75#p260233) I made something similar. Find (nearly) all freebasic keywords within the tetris grid (up/down, left/right) using "instr". Code without the game: Find all keywords within a string. I your case the dictionary will be a bit larger, but I don't expect a problem with that. The grid seems smaller in your case.
Re: How to get and use a dictionary
Thank you all for your help.
I used dodicat's database of words but instead of using the instr method (does not work for my purpose), I indexed each of the words . I am now able to compare if a word is actually a word in the database.
Dodicat's database is OK, but it contains many abbreviations and acronyms which have to be edited out,. Example NBC or NFL are not a real words. I am working on it.
If anyone knows how to access the database (dictionary) used by Windows or the one in this editor used to create the forums posts please help.
Thank you
Paul22
I used dodicat's database of words but instead of using the instr method (does not work for my purpose), I indexed each of the words . I am now able to compare if a word is actually a word in the database.
Dodicat's database is OK, but it contains many abbreviations and acronyms which have to be edited out,. Example NBC or NFL are not a real words. I am working on it.
If anyone knows how to access the database (dictionary) used by Windows or the one in this editor used to create the forums posts please help.
Thank you
Paul22
Re: How to get and use a dictionary
There are open source dictionaries which are used by e.g. Firefox.
E.g. this one: https://sourceforge.net/projects/wordli ... Dicts/6.0/
E.g. this one: https://sourceforge.net/projects/wordli ... Dicts/6.0/
Re: How to get and use a dictionary
In the meantime here is Collin's scrabble dictionary.
There are weird but OK words in there also.
I have included a viewer to see the first and last few entries.
My favourite is number 276643.
Number 15 might be your comment.
https://www.mediafire.com/file/46ng481x ... y.zip/file
There are weird but OK words in there also.
I have included a viewer to see the first and last few entries.
My favourite is number 276643.
Number 15 might be your comment.
https://www.mediafire.com/file/46ng481x ... y.zip/file
-
- Posts: 1186
- Joined: May 08, 2006 21:58
- Location: Crewe, England
Re: How to get and use a dictionary
Probably what you need is not a "dictionary" but a "word list"; try searching for that. There appears to be one on Github in text format. I got one for a Boggle-type game I developed in Freebasic years ago, building on somebody else's idea.
Such lists may contain non-English words picked up by some web-crawler, e.g. obscure foreign currency names.
Such lists may contain non-English words picked up by some web-crawler, e.g. obscure foreign currency names.
Re: How to get and use a dictionary
In my mediafire link, splitter.txt should have been splitter.bas.
Re: How to get and use a dictionary
Again, thank you all for your suggestions.
I downloaded Badidea's database of words. It works great. No modifications needed.
Long live FREEBASIC
Paul22
I downloaded Badidea's database of words. It works great. No modifications needed.
Long live FREEBASIC
Paul22
-
- Posts: 252
- Joined: Mar 12, 2006 16:25
Re: How to get and use a dictionary
https://github.com/first20hours/google- ... swears.txt
Here is another word list. Just remove all 1-2 char words with regexp and then you could manually modify the file further.
regexp search and replace with editor:
^([a-z]{1,2})\r\n
Here is another word list. Just remove all 1-2 char words with regexp and then you could manually modify the file further.
regexp search and replace with editor:
^([a-z]{1,2})\r\n
Last edited by RockTheSchock on Jun 03, 2019 16:22, edited 1 time in total.
-
- Posts: 534
- Joined: Dec 02, 2011 22:51
- Location: France
Re: How to get and use a dictionary
You're welcome have a look to LZLE (if you didn't yet). Perhaps you will like it, perhaps not.I indexed each of the words