Results 1 to 11 of 11
Thread: Java synonyms
- 05-22-2012, 02:34 PM #1
Member
- Join Date
- May 2012
- Posts
- 5
- Rep Power
- 0
- 05-22-2012, 02:46 PM #2
Re: Java synonyms
What have you tried? Where are you stuck? It's pretty impossible to answer general "how do I do this" type questions other than to point you to google or the basic tutorials. How would you do this without a computer?
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 05-22-2012, 02:53 PM #3
Member
- Join Date
- May 2012
- Posts
- 5
- Rep Power
- 0
Re: Java synonyms
It havnt found anything on google that explains to me what I could use. I have searched a while now. thought if somebody in this forum could me just to get started, and then I'll post my work when I get stuck
- 05-22-2012, 03:00 PM #4
Re: Java synonyms
How would you use a HashMap? How would you use "nodes"?
There are too many ways to solve a problem to simply list them, and how you should solve it depends on what you're familiar with.How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 05-22-2012, 03:08 PM #5
Member
- Join Date
- May 2012
- Posts
- 5
- Rep Power
- 0
Re: Java synonyms
I thought of using HashMap, HashMap<String,String[]>. But with HashMap you can get one Value to a Key. Can I use a MultiMap to store more synonyms for a word, than just one?
- 05-22-2012, 03:11 PM #6
Member
- Join Date
- May 2012
- Posts
- 5
- Rep Power
- 0
Re: Java synonyms
I will write a code now for it, and soon present to you using hashMap.
- 05-22-2012, 03:22 PM #7
Re: Java synonyms
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 05-22-2012, 04:37 PM #8
Re: Java synonyms
Or a Map<String, Set<String>>
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 05-22-2012, 04:50 PM #9
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
Re: Java synonyms
You can take the idea a bit further: if B is a synonym for A then A is a key in the Map and B appears as an element in the value Set. But also B is a key in the Map and A appears as a member in the value Set. In other words: if B is a synonym for A then A is a synonym for B;. This implies that the value Sets for A and B can be one Set, pointed to by both A and B. A bit of careful construction of the Map takes care of this relation and it shrinks the footprint of the Map ...
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-28-2012, 02:03 PM #10
Member
- Join Date
- May 2012
- Posts
- 5
- Rep Power
- 0
Re: Java synonyms
But How can I make a Set of Values to appear as Key. If B, C, D is synonym for A. If I make 100 different synonyms, is there an easy way to apply this for 100 synonyms for example?
- 05-28-2012, 02:06 PM #11
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks