Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Here is a quick example.
$ python
>>> import pysentencizer
>>> sentencizer = pysentencizer.Sentencizer()
>>> print sentencizer.sentencize("Testing.")
>>> print(sentencizer.sentencize("Testing."))
['Testing'/sent_start/para_start/word/capital/verb/VBG, '.'/sent_end/para_end/punc]

The script example.py demonstrates the ability to tokenize and then print
Expand Down
8 changes: 4 additions & 4 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

senticizer = pysentencizer.Sentencizer()
tokens = senticizer.sentencize(input)
print tokens
print(tokens)

for token in tokens:
if token.isSentenceStart:
print "\n>>> ",
print("\n>>> ", end=' ')
text = token.getRawText().replace("\n"," ").replace("\r","")
sys.stdout.write(text)
if token.isParaEnd:
print
print
print()
print()
2 changes: 1 addition & 1 deletion pysentencizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from pysentencizer import *
from .pysentencizer import *
6 changes: 3 additions & 3 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ def timeSentencizeWarAndPeace():
return stop - start

if __name__ == "__main__":
print "Running tests."
print("Running tests.")
if len(sys.argv) > 1:
if sys.argv[1] == "-p":
TEST_PERFORMANCE = True
else:
print "WARNING: Unknown option",sys.argv[1]
print("WARNING: Unknown option",sys.argv[1])
else:
print "Not testing performance. Use -p to run performance tests."
print("Not testing performance. Use -p to run performance tests.")

doctest.testmod()