Aug 17, 2018

Playing around with a word counter

I write bits and pieces of code on the side, even though it seems that people find it hard to believe that managers in India can actually code. Most of the code is usually small tools I write to automate parts of my work. But sometimes, I write code which should be ok for use for other people also.

Recently, I decided to put one of these code pieces online. This is the word counter and you can get it on the github gist at : https://gist.github.com/vibhurishi/3d4793e60e24af8ebb9ebd9c547b8222

As a test text, I was looking for something that would be of relevance. Since we just celebrated our 72nd Independence day, I took Jawaharlal Nehru's epic speech on the night of Independence and ran it through the word counter. Below is the result.

tryst.txt
about               1
accept              1
achievement         1
achievements        1
act                 1
action              1
advance             1
adventure           1
afresh              1
after               1
age                 1
ago                 1
ahead               1
allow               1
aloft               1
ambition            1
ancient             1
anew                1
apart               1
appeal              1
architect           1
asia                1
assembly            1
await               1
bear                1
begins              1
being               1
belong              1
betrayed            1
beyond              1
bind                1
birth               1
blaming             1
blown               1
body                1
bold                1
boundaries          1
brave               1
brings              1
brothers            1
burdens             1
cause               1
celebrate           1
centuries           1
challenge           1
cherished           1
citizens            1
clings              1
closely             1
clouds              1
common              1
communalism         1
confidence          1
continue            1
cooperate           1
country             1
courage             1
create              1
criticism           1
cut                 1
darkness            1
dawn                1
death               1
dedication          1
democracy           1
democratic          1
destructive         1
difficult           1
disaster            1
disciplined         1
discovers           1
dwell               1
ease                1
east                1
economic            1
embodying           1
encompass           1
encourage           1
endeavour           1
ending              1
ends                1
endured             1
ensure              1
equal               1
equally             1
eternal             1
ever                1
eye                 1
face                1
failures            1
fateful             1
father              1
fight               1
filled              1
finds               1
first               1
fitting             1
followers           1
forgotten           1
forth               1
fragments           1
fulfil              1
fullness            1
furthering          1
gave                1
generation          1
generations         1
give                1
grandeur            1
grasp               1
greater             1
greatest            1
greetings           1
happen              1
heavy               1
held                1
herself             1
hind                1
homage              1
hour                1
however             1
humanity            1
humility            1
ideals              1
imagine             1
imprint             1
incessant           1
independent         1
indivisible         1
inequality          1
institutions        1
intended            1
isolated            1
jai                 1
join                1
justice             1
knit                1
larger              1
lighted             1
longer              1
lost                1
loved               1
made                1
magnificent         1
mansion             1
many                1
materializes        1
memory              1
midnight            1
millions            1
mindedness          1
motherland          1
must                1
nevertheless        1
next                1
noble               1
obligations         1
off                 1
only                1
opening             1
pay                 1
peasants            1
period              1
petty               1
point               1
power               1
praise              1
present             1
privileges          1
problems            1
progressive         1
prosperity          1
prosperous          1
rarely              1
reality             1
rejoice             1
religion            1
remain              1
remember            1
representatives     1
representing        1
responsibilities     1
rests               1
reverent            1
reward              1
rights              1
rises               1
said                1
send                1
served              1
set                 1
share               1
sharers             1
she                 1
sight               1
sisters             1
sleeps              1
slumber             1
social              1
soldiers            1
solemn              1
son                 1
soul                1
split               1
standard            1
stands              1
started             1
stormy              1
strayed             1
stricken            1
stroke              1
struggle            1
substantially       1
succeeding          1
success             1
suffer              1
suffering           1
suppressed          1
surround            1
surrounded          1
tear                1
tears               1
tempest             1
think               1
though              1
thought             1
through             1
together            1
too                 1
trackless           1
triumphs            1
tryst               1
turning             1
unending            1
unhappily           1
unknown             1
unto                1
unworthy            1
upon                1
utterance           1
verge               1
very                1
vision              1
vital               1
volunteers          1
where               1
whither             1
wholly              1
wind                1
wipe                1
wise                1
without             1
woman               1
workers             1
write               1
years               1
yet                 1
again               2
alike               2
any                 2
appointed           2
as                  2
awake               2
beckons             2
before              2
bring               2
build               2
by                  2
cannot              2
children            2
come                2
disease             2
do                  2
dreams              2
end                 2
enough              2
faith               2
full                2
go                  2
good                2
hard                2
hearts              2
high                2
hope                2
ignorance           2
into                2
labour              2
life                2
make                2
means               2
measure             2
message             2
much                2
narrow              2
nations             2
old                 2
others              2
ourselves           2
out                 2
over                2
pains               2
peace               2
peoples             2
pledges             2
political           2
poverty             2
quest               2
responsibility      2
resting             2
some                2
sorrow              2
sovereign           2
spirit              2
step                2
still               2
strength            2
striving            2
take                2
taken               2
their               2
there               2
they                2
those               2
thoughts            2
till                2
torch               2
what                2
whatever            2
whose               2
also                3
an                  3
can                 3
day                 3
destiny             3
even                3
every               3
fortune             3
free                3
his                 3
live                3
man                 3
moment              3
often               3
past                3
redeem              3
star                3
time                3
up                  3
at                  4
been                4
comes               4
from                4
future              4
great               4
history             4
ill                 4
nation              4
never               4
new                 4
now                 4
opportunity         4
pledge              4
service             4
them                4
today               4
which               4
work                4
has                 5
no                  5
one                 5
when                5
who                 5
world               5
all                 6
long                6
may                 6
shall               6
people              7
will                7
her                 8
so                  8
or                  9
be                 11
freedom            14
our                14
us                 16
india              18
we                 37
('Number of words in the file :', 1099)