Closed Yongbaek-Kim closed 5 years ago
You can use ngram.order()
in the latest on github (thanks @heckendorfc !)
library(ngram)
txt <- "1 2 3 4 5 6 7 8 9 2 11"
ng = ngram(txt)
get.ngrams(ng)[ngram.order(ng)]
## [1] "1 2" "2 3" "3 4" "4 5" "5 6" "6 7" "7 8" "8 9" "9 2" "2 11"
I ran the above in RStudio 3.5.2 in Win10. I hope the function results in order of input for better debugging. Can it be possible?