Words That Give You Away

I used to be a debater, and a judge once commented that I filled verbal pauses by starting sentences with "clearly." That was around 1997; I've been conscious of it ever since.
Same as people that literally say literally ever sentence
 
After seeing this thread, I wrote a little python app to give the zipf frequency of words in your story:
Python:
import math

from wordfreq import zipf_frequency
import argparse

if __name__ == '__main__':

    parser = argparse.ArgumentParser(description='Zipf frequency of worsd in a story (text file only)')
    parser.add_argument('-f', '--file', type=str, required=True, help='File to read')

    args = parser.parse_args()
    n_words = 0
    wordcount = {}


    def to_zipf_frequency(word):
        return math.log10(wordcount[word] / n_words * 1_000_000_000)


    with open(args.file, 'r') as f:
        for line in f:
            words = line.split()
            n_words += len(words)
            for word in words:
                wordcount[word] = wordcount.get(word, 0) + 1

    print('Number of words: ', n_words)
    for word, v in sorted(wordcount.items(), key=lambda x: x[1], reverse=True):
        f_samp = to_zipf_frequency(word)
        f_zipf = zipf_frequency(word, 'en')
        if (f_samp - f_zipf) > 1 and f_zipf > 3:
            print(word, f_samp, f_zipf)
 
"Very large breasts." It's weird; I can't explain it. But nearly every female character in my stories just seems to have them. I don't make the rules.
 
After seeing this thread, I wrote a little python app to give the zipf frequency of words in your story:
Python:
import math

from wordfreq import zipf_frequency
import argparse

if __name__ == '__main__':

    parser = argparse.ArgumentParser(description='Zipf frequency of worsd in a story (text file only)')
    parser.add_argument('-f', '--file', type=str, required=True, help='File to read')

    args = parser.parse_args()
    n_words = 0
    wordcount = {}


    def to_zipf_frequency(word):
        return math.log10(wordcount[word] / n_words * 1_000_000_000)


    with open(args.file, 'r') as f:
        for line in f:
            words = line.split()
            n_words += len(words)
            for word in words:
                wordcount[word] = wordcount.get(word, 0) + 1

    print('Number of words: ', n_words)
    for word, v in sorted(wordcount.items(), key=lambda x: x[1], reverse=True):
        f_samp = to_zipf_frequency(word)
        f_zipf = zipf_frequency(word, 'en')
        if (f_samp - f_zipf) > 1 and f_zipf > 3:
            print(word, f_samp, f_zipf)
Oh, I like you...
 
My characters will often perform their toilets in its second meaning - "the act or process of dressing and grooming oneself."
 
Back
Top