.. CS116 documentation master file, created by
   sphinx-quickstart on Mon Mar  4 10:37:08 2019.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Text
====

A Text object contains text from a txt file.


Example Usage
-------------

.. code:: python
   
   filename = pickAFile()
   text = Text(filename)
   
   print(text.getWords())

Initialization
--------------

.. py:function:: Text.Text(self, filename)
   
   :param string filename: the name of the text file.
   
.. code:: python

   filename = pickAFile()
   text = Text(filename)

Methods
-------

Print all words in the text whose length is less than three.

.. py:function:: Text.printSmallWords(self)

.. code:: python

   text.printSmallWords()

Getters
-------

Return a list of the words in the text.

.. py:function:: Text.getWords(self)

.. code:: python

   # Loop through the words, printing each one.
   for word in text.getWords():
      print(word)

Return a list of the lines in the text.

.. py:function:: Text.getLines(self)

.. code:: python

   # Loop through the text's lines, printing each one.
   for line in text.getLines():
      print(line)
   

