Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add argument #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions readability.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
from utils import get_sentences
from utils import count_syllables
from utils import count_complex_words
import argparse
import codecs

parser = argparse.ArgumentParser()
parser.add_argument('-data', required=True, type=str, help='the path of the data')

opt = parser.parse_args()
print(opt)

class Readability:
analyzedVars = {}
Expand Down Expand Up @@ -92,8 +99,8 @@ def RIX(self):


if __name__ == "__main__":
text = """We are close to wrapping up our 10 week Rails Course. This week we will cover a handful of topics commonly encountered in Rails projects. We then wrap up with part 2 of our Reddit on Rails exercise! By now you should be hard at work on your personal projects. The students in the course just presented in front of the class with some live demos and a brief intro to to the problems their app were solving. Maybe set aside some time this week to show someone your progress, block off 5 minutes and describe what goal you are working towards, the current state of the project (is it almost done, just getting started, needs UI, etc.), and then show them a quick demo of the app. Explain what type of feedback you are looking for (conceptual, design, usability, etc.) and see what they have to say. As we are wrapping up the course you need to be focused on learning as much as you can, but also making sure you have the tools to succeed after the class is over."""

with codecs.open(opt.data, 'r', 'utf-8') as f:
text = f.read().encode('utf-8')
rd = Readability(text)
print 'Test text:'
print '"%s"\n' % text
Expand Down