What algorithm I need to find n-grams?

前端 未结 7 499
無奈伤痛
無奈伤痛 2020-12-04 16:56

What algorithm is used for finding ngrams?

Supposing my input data is an array of words and the size of the ngrams I want to find, what algorithm I should use?

7条回答
  •  旧巷少年郎
    2020-12-04 17:38

    For anyone still interested in this topic, there is a package on the cran already.

    ngram: An n-gram Babbler

    This package offers utilities for creating, displaying, and "babbling" n-grams. The babbler is a simple Markov process.

    http://cran.r-project.org/web/packages/ngram/index.html

提交回复
热议问题