<commit_before><commit_msg>Word class explorer<commit_after>;
; grammatical class explorer
; Display stats and stuff, about the various word classes.
;
;
How many grammatical classes are there?
(cog-count-atoms 'WordClassNode)

; Show them all
(cog-get-atoms 'WordClassNode)

; Show the members.
(map (lambda (atom) (cog-incoming-by-type atom 'MemberLink))
	(cog-get-atoms 'WordClassNode))

; Print the members
(define (prt-members-of-class CLS)
	(define membs (cog-incoming-by-type CLS 'MemberLink))
	(format #t "Class <~A> has ~A members:\n"
		(cog-name CLS) (length membs))
	(for-each
		(lambda (memb)
			(format #t "      ~A\n" (cog-name (gar memb))))
		membs))


; Print all classes and members
(for-each prt-members-of-class (cog-get-atoms 'WordClassNode))

{'fraction_non_alphanumeric': 0.1402359108781127, 'fraction_numerical': 0.0, 'mean_word_length': 4.418439716312057, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5390252', 'n_tokens_mistral': 293, 'n_tokens_neox': 281, 'n_words': 80}