8 Reusable Code Snippet Topics
Remove Filter
|
|
This snippet defines a function returning new identifiers created from reading the computer's time. |
|
A little experiment with custom sorting the result of a word frequency count using Google's Go language. |
|
This short snippet shows you how to preprocess a text to remove punctuation marks, then do a word frequency count using Counter() from the Python module collections. Finally, two sorts are applied to display words with matching frequency in alphabetical order. |
|
This Python code allows you to get selected statistics of a story text. It will count lines, sentences, words, list words and characters by frequency, and give the average word length. It should be easy to add more statistics using the dictionaries created. |
|
As in C++ was some question about speed of simple hard disk based lookup, here is a version of unscramble program completely HD based lookup, which gives all possible candidate words for multiword anagram. Program is not sensitive for case of words but does not ignore special characters like ' … |
|
This is my code for anagrams not utilizing the ready prepared file of anagram synonyms to celebrate 11.11.11 11:11:11. If you start program it warns you about missing subdirectory dict and creates it. You may put any word files, one word per line, to file <dictionary name>.txt. Program lists available … |
|
This handy function turns file into stream of words stripped of punctuation, whitespace and digits, but does not split for example we'd to two words. If you want that you can further process yielded words or change the definition. |
|
Here is my practise with [URL="http://www.boggled.org/"]boggle [/URL]letter square non-overlapping word finder after some drastic debugging and cleaning. I think it is reasonable speed also. Comments wellcome. |
The End.