Categorizing Words and Category Values

前端 未结 21 1654
温柔的废话
温柔的废话 2021-01-31 05:49

We were set an algorithm problem in class today, as a \"if you figure out a solution you don\'t have to do this subject\". SO of course, we all thought we will give it a go.

21条回答
  •  孤街浪徒
    2021-01-31 06:39

    My naive approach:

    1. Create a huge text file like this (read the article for inspiration)
    2. For every word, scan the text and whenever you match that word, count the 'categories' that appear in N (maximum, aka radio) positions left and right of it.
    3. The word is likely to belong in the category with the greatest counter.

提交回复
热议问题