simongray / sino.study

A modern Chinese dictionary.
http://sino.study/
8 stars 0 forks source link

Order definitions according to custom ordering method #37

Open simongray opened 6 years ago

simongray commented 6 years ago
simongray commented 6 years ago

SortedSet + a sorting function is probably the best approach for this.

Can it be done already on the backend and then survive being transmitted by transit?

Will certain sorting only be applicable on the frontend? Probably not, but filtering might apply.

simongray commented 6 years ago

Rather than taking the aforementioned approach, instead consider this:

Use CoreNLP to give each definition a word class by its root word. Group as in classic dictionaries in numbered lists (as now) but under each word category, e.g. noun, verb, adjective, adverb. This is much easier on the eyes, easier to scan for the correct definition ("I need a verb") and uses more of the unused whitespace.

simongray commented 6 years ago

img_20180902_003034

simongray commented 6 years ago

Similarly, when showing the search results, only show the definitions that are of that word same word class with the searched for definition first.

simongray commented 6 years ago

another alternative approach is to use wordnet instead and use the synset groups to determine word class by using the word class that has the most synset connections among the other definitions. If no connections exist, then the CoreNLP method can be used as a fall back.

This would hopefully categorise "kind" as an adjective when grouped with "generous" "gentle" etc. and as a noun when grouped with "sort" or "type". Then for those longer definitions, CoreNLP might be strongest: "a gentle soul" -> noun "trying too hard" -> verb or maybe adverb?