Skip to content

Commit 814b459

Browse files
committed
Finalized readme for initial release.
1 parent 354770c commit 814b459

File tree

1 file changed

+38
-9
lines changed

1 file changed

+38
-9
lines changed

README.rst

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,51 @@ pointofview
1313
:target: https://www.codacy.com/app/ProseGrinder/python-pointofview?utm_source=github.com&utm_medium=referral&utm_content=prosegrinder/python-pointofview&utm_campaign=Badge_Grade
1414
:alt: Latest Codacy Coverage Report
1515

16-
A Python package for determine a text's point of view (first, second, third, or unknown).
16+
A Python package for determining a piece of text's point of view (first, second, third, or unknown).
17+
18+
Installation
19+
------------
20+
21+
``pointofview`` is available on PyPI. Simply install it with ``pip``::
22+
23+
$ pip install pointofview
24+
25+
You can also install it from source::
26+
27+
$ git clone https://github.com/prosegrinder/python-pointofview.git
28+
Cloning into 'python-pointofview'...
29+
...
30+
31+
$ cd python-pointofview
32+
$ python setup.py install
33+
...
1734

1835
Usage
1936
-----
2037

21-
Installation
22-
------------
38+
``pointofview`` guesses a text's point of view by counting point of view pronouns. The main function ``get_pov()`` will return 'first', 'second', 'third', or null (Python's ``None`` object)::
2339

24-
Requirements
25-
^^^^^^^^^^^^
40+
>>> import pointofview
41+
>>> text = "I'm a piece of text written in first person! What are you?"
42+
>>> pointofview.get_pov(text)
43+
'first'
2644

27-
Compatibility
28-
-------------
45+
There are two other helper functions as well.
2946

30-
License
31-
-------
47+
``get_word_pov()`` returns the point of view of a single word::
48+
49+
>>> pointofview.get_word_pov("I")
50+
'first'
51+
>>> pointofview.get_word_pov("nope")
52+
None
53+
54+
``parse_pov_words`` returns a dict containing all first, second, and third person pov words::
55+
56+
>>> text = """
57+
... When I try to analyze my own cravings, motives, actions and so forth, I surrender to a sort of retrospective imagination which feeds the analytic faculty with boundless alternatives and which causes each visualized route to fork and re-fork without end in the maddeningly complex prospect of my past.
58+
... """
59+
>>> pointofview.parse_pov_words(text)
60+
{'first': ['i', 'i'], 'second': [], 'third': []}
3261

3362
Authors
3463
-------

0 commit comments

Comments
 (0)