Skip to content

Commit

Permalink
Fixed variable name - text2 changed to text
Browse files Browse the repository at this point in the history
Added support for ",;" in sentence boundaries
  • Loading branch information
aneesha committed Jul 26, 2012
1 parent 75b7820 commit 9869d1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rake.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def separatewords(text,minWordReturnSize):
# Utility function to return a list of sentences.
# @param text The text that must be split in to sentences.
def splitSentences(text):
sentenceDelimiters = re.compile('[.!?]')
sentenceDelimiters = re.compile('[.!?,;]')
sentenceList = sentenceDelimiters.split(text)
return sentenceList

Expand Down Expand Up @@ -88,7 +88,7 @@ def generateCandidateKeywordScores(phraseList, wordscore):
text = "Compatibility of systems of linear constraints over the set of natural numbers. Criteria of compatibility of a system of linear Diophantine equations, strict inequations, and nonstrict inequations are considered. Upper bounds for components of a minimal set of solutions and algorithms of construction of minimal generating sets of solutions for all types of systems are given. These criteria and the corresponding algorithms for constructing a minimal supporting set of solutions can be used in solving all the considered types of systems and systems of mixed types."

# Split text into sentences
sentenceList = splitSentences(text2)
sentenceList = splitSentences(text)
stoppath = "englishstop.txt"
stopwordpattern = buildStopwordRegExPattern(stoppath)

Expand Down

0 comments on commit 9869d1d

Please sign in to comment.