Code Monkey home page Code Monkey logo

alliteration_tracker's Introduction

Alliteration Tracker

Created by: Eryn Lyle, 07/12/17 Tested with files from Folger Digital Texts Python 3.6

The Alliteration Tracker/Counter allows users to collect large datasets about the use of alliteration in texts, specifically plays. It was created to analyze the open-access Folger Digital Texts editions of The Complete Works of William Shakespeare, but can be adapted to any line-division based text (drama, poetry, etc) provided to user changes the regexes to fit their needs.

Adding Play Files

Add play files into a folder called 'plays' The extractor will divide them into acts. Depending on the source/formatting of the specific play you may need to change the regular expressions to accurately capture act divisions [This is done in the extractor.py file]

Analyzing Plays

Change regexs in alliteration.py to match play's specific features Current regexs are for analysis of a Folger Digital Text .txt file Results contain both alliteration counts and what specific letters are repeated They are divided into acts and contained within the 'results' folder of each play

Alliteration Number

alliteration_number equals the number of times a letter needs to be repeated for it to be 'alliteration' Ex: 'We will run' would be classified as alliteration if alliteration_number = 1 But NOT if alliteration_number = 2 alliteration_number = 1: "We Will run into the Woods" is TRUE [repeated 1+ times] alliteration_number = 2: "We Will run into the Woods" is TRUE [repeated 2+ times] alliteration_number = 3: "We Will run into the Woods" is FALSE [NOT repeated 3+ times]

Result Outputs

In each act's result file is every letter that is alliterated, per line. Some lines have multiple letters that repeat Ex. We wish we wish upon a shooting star would return {w, s}, assuming alliteration_number = 1 At the bottom, the total counter number of lines with alliteration are displayed

Turning on/off stopwords

Turning stopwords on means common words like "and", "if", "can", "he", etc. will be removed. If you wish to turn stopwords on/off, in alliteration.py set the variable 'stpwds' to True/False in def loop_through_lines The default setting is stopwords off. Common words will NOT be removed.

alliteration_tracker's People

Contributors

erynlyle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.