I am after a list of the words occurring two or more times in 'title-words, that are "good", sorted by frequency (high to low).
Here I try:
Code: Select all
#/usr/local/bin/newlisp
; my list of words:
(set 'title-words '("one" "two" "two" "three" "three" "three" "four" "four" "four" "four" "five" "five" "five" "five" "five" "six" "six"))
; words to remove from my list:
(set 'bad-title-words '("two" "four"))
; the "good" words i want:
(set 'good (difference title-words bad-title-words))
; an index count of the good words frequencies:
(set 'title-words-index (count good title-words))
; good word frequencies that occur more than once in my list
(set 'big-title-words-index (ref-all '1 title-words-index < true))
(println title-words) ; initial list of words
:-> ("one" "two" "two" "three" "three" "three" "four" "four" "four" "four" "five" "five" "five" "five" "five" "six" "six")
(println bad-title-words) ; words to remove
;-> ("two" "four")
(println good) ; words i want to keep
;-> ("one" "three" "five" "six")
(println title-words-index) ; a count of good word frequency
;-> (1 3 5 2)
(println big-title-words-index) ; somehow related to the words i want to get and sort by frequency
;-> (3 5 2)
(exit)
I would appreciate any directions back to my path! :0)