I'm using the minimum "cost" to travel from a word to its successor to be 1. So the best solution to find a path from one word to another is to use the A* (A star) path finding. Each path is weighted with a cost, which is the weight you have on the source file. Let's think of the words as being a node on a graph, each relationship of similarity a word has with another is a path on that graph. I will always use the sequence below, when I'm giving any example:īlack-dark-obscure-hidden-concealed-snug-comfortable-easy-simple-pure-white Since you said your source is a large thesaurus with weighted data, I'm assuming if you pick any word, you will have the weight to its successor in the similarity graph. My current algorithm involves recursively descending a few levels from the start and end words, and then looking for intercepting words, but that becomes too slow with thousands of sqlite (or Realm) selects. I'm sure there's a ton of prior research on these kinds of problems, and I'd appreciate pointers on what might be applied to this. What optimization strategies do you recommend to make this realistic, e.g., within 5 seconds of processing on a typical iOS device? Assume the thesaurus has half a million terms, each with 20 associations. (e.g., "outlaw" is closely related to "bandit", but more distantly related to "rogue.") Our actual values range from 0.001 to ~50, but you can assume any weight range. My source is a very large thesaurus with weighted data, where the weights measure similarity between words. The goal is to return a chain from within a weighted graph of word relations. I'm working on a thesaurus iOS app, and I would like to display synonym chains also. ![]() ![]() True-just=fair=beautiful=pretty-artful-artificial-sham- false For example, the English words "black" and "white" can connected as:īlack-dark-obscure-hidden-concealed-snug-comfortable-easy-simple-pure- white A synonym chain is a series of closely related words that span two anchors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |