1.2.3-SNAPSHOT permalink Arrow_down_16x16

n-grams

incanter.stats

  • (n-grams n s)
returns a set of the unique n-grams in a string.

this is using actual sets here, discards dupicate n-grams?

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/stats.clj:3073 top

(defn n-grams
"returns a set of the unique n-grams in a string.

this is using actual sets here, discards dupicate n-grams?
"
 [n s] 
(into 
 #{}
 (map 
  #(apply str %) 
  (partition n 1 s))))
Vars in incanter.stats/n-grams: apply defn into map partition str
Used in 0 other vars

Comments top

No comments for n-grams. Log in to add a comment.