Skip to content

Commit

Permalink
Adds documentation for NWI functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsroten committed Jul 13, 2015
1 parent 1cf2d01 commit 1a9e095
Showing 1 changed file with 56 additions and 2 deletions.
58 changes: 56 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ the API.
:param str license_code: The license code that should be used when
initializing NLPIR. This is generally only used by commercial users.
:raises RuntimeError: The NLPIR API failed to initialize. Sometimes, NLPIR
leaves an error log in the current working directory that provides
more detailed messages (but this isn't always the case).
leaves an error log in the current working directory or NLPIR's
``Data`` directory that provides more detailed messages (but this isn't
always the case).

.. function:: close

Expand Down Expand Up @@ -374,6 +375,59 @@ allocated memory.
:returns: ``0`` if the function failed, otherwise ``1``.
:rtype: int

.. function:: NWI_Start()

Initializes new word identification.

:returns: ``True`` if the function succeeded; ``False`` if it failed.
:rtype: bool

.. function:: NWI_AddFile(filename)

Adds the words in a text file.

:param string filename: The text file's filename.
:returns: ``True`` if the function succeeded; ``False`` if it failed.
:rtype: bool

.. function:: NWI_AddMem(filename)

Increases the allotted memory for new word identification.

:param string filename: NLPIR's documentation is unclear on what this
argument is for.
:returns: ``True`` if the function succeeded; ``False`` if it failed.
:rtype: bool

.. function:: NWI_Complete()

Terminates new word identifcation. Frees up memory and resources.

:returns: ``True`` if the function succeeded; ``False`` if it failed.
:rtype: bool

.. function:: NWI_GetResult(weight)

Returns the new word identification results.

:param bool weight: Whether or not to include word weights in the results.
:returns: ``True`` if the function succeeded; ``False`` if it failed.
:returns: The identified words.
:rtype: str

.. function:: NWI_Results2UserDict()

Adds the newly identified words to the user dictionary.

This function should only be called after
:func:`~pynlpir.nlpir.NWI_Complete` is called.

If you want to save the user dictionary, consider running
:func:`~pynlpir.nlpir.SaveTheUsrDic`.

:returns: ``1`` if the function succeeded; ``0`` if it failed.
:rtype: int


.. module:: pynlpir.pos_map

Expand Down

0 comments on commit 1a9e095

Please sign in to comment.