Skip to content

Commit 20c296e

Browse files
committed
Use same sample text as on LanguageTool usage page.
1 parent e0e03a6 commit 20c296e

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

‎README.rst‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Example usage
77

88
>>> import language_tool
99
>>> lang_tool = language_tool.LanguageTool("en-US")
10-
>>> text = "but it’s suppose to be all yellowy."
10+
>>> text = "A sentence with a error in the Hitchhiker’s Guide tot he Galaxy"
1111
>>> matches = lang_tool.check(text)
1212
>>> len(matches)
1313
2
@@ -16,29 +16,29 @@ Example usage
1616
Check out some ``Match`` object attributes:
1717

1818
>>> matches[0].fromy, matches[0].fromx
19-
(0, 0)
19+
(0, 16)
2020
>>> matches[0].ruleId, matches[0].replacements
21-
('UPPERCASE_SENTENCE_START', ['But'])
21+
('EN_A_VS_AN', ['an'])
2222
>>> matches[1].fromy, matches[1].fromx
23-
(0, 9)
23+
(0, 50)
2424
>>> matches[1].ruleId, matches[1].replacements
25-
('SUPPOSE_TO', ['supposed'])
25+
('TOT_HE', ['to the'])
2626

2727

2828
Print a ``Match`` object:
2929

3030
>>> print(matches[1])
31-
Line 1, column 10, Rule ID: SUPPOSE_TO[1]
32-
Message: Probably you should use a past participle here: 'supposed'.
33-
Suggestion: supposed
34-
but it’s suppose to be all yellowy.
35-
^^^^^^^
31+
Line 1, column 51, Rule ID: TOT_HE[1]
32+
Message: Did you mean 'to the'?
33+
Suggestion: to the
34+
... with a error in the Hitchhiker’s Guide tot he Galaxy
35+
^^^^^^
3636

3737

3838
Automatically apply suggestions to the text:
3939

4040
>>> language_tool.correct(text, matches)
41-
'But it’s supposed to be all yellowy.'
41+
'A sentence with an error in the Hitchhiker’s Guide to the Galaxy'
4242

4343

4444
Installation

0 commit comments

Comments
 (0)