Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (38 sloc) 1.46 KB

Detecting sentences

Detecting sentences in a single line text or article.


$ ./
No parameter has been passed. Please see usage below:

       Usage: ./ --text [text]
                 --file [path/to/filename]

       --text      plain text surrounded by quotes
       --file      name of the file containing text to pass as command arg
       --help      shows the script usage help text


$ ./ --text "This is an english sentence. And this is another sentence."
Checking if model en-sent.bin (en) exists...
Found model en-sent.bin (en)
Loading Sentence Detector model ... done (0.137s)
This is an english sentence.
And this is another sentence.

Average: 117.6 sent/s
Total: 2 sent
Runtime: 0.017s
Execution time: 0.414 seconds

Similarly a file containing text can be passed in as:

$ ./ --file article.txt

Note: if you miss out sentence ending delimeters (like a period ==> .) then it considers the whole text as a sentence till it finds the next delimeter terminating the sentence.


Contributions are very welcome, please share back with the wider community (and get credited for it)!

Please have a look at the CONTRIBUTING guidelines, also have a read about our licensing policy.

Back to main page (table of contents)

You can’t perform that action at this time.