<s> from textplot . text import Text <EOL> def test_set_tokens ( ) : <EOL> """<STR_LIT>""" <EOL> t = Text ( '<STR_LIT>' ) <EOL> assert t . tokens [ <NUM_LIT:0> ] [ '<STR_LIT>' ] == '<STR_LIT>' <EOL> assert t . tokens [ <NUM_LIT:1> ] [ '<STR_LIT>' ] == '<STR_LIT>' <EOL> assert t . tokens [ <NUM_LIT:2> ] [ '<STR_LIT>' ] == '<STR_LIT>' <EOL> assert len ( t . tokens ) == <NUM_LIT:3> <EOL> def test_set_term_offsets ( ) : <EOL> """<STR_LIT>""" <EOL> t = Text ( '<STR_LIT>' ) <EOL> assert t . terms [ '<STR_LIT>' ] == [ <NUM_LIT:0> , <NUM_LIT:2> ] <EOL> assert t . terms [ '<STR_LIT>' ] == [ <NUM_LIT:1> , <NUM_LIT:3> ] <EOL> def test_ignore_stopwords ( ) : <EOL> """<STR_LIT>""" <EOL> t = Text ( '<STR_LIT>' ) <EOL> assert t . tokens [ <NUM_LIT:0> ] [ '<STR_LIT>' ] == '<STR_LIT>' <EOL> assert t . tokens [ <NUM_LIT:1> ] == None <EOL> assert t . tokens [ <NUM_LIT:2> ] [ '<STR_LIT>' ] == '<STR_LIT>' <EOL> assert t . tokens [ <NUM_LIT:3> ] == None <EOL> assert t . tokens [ <NUM_LIT:4> ] [ '<STR_LIT>' ] == '<STR_LIT>' <EOL> assert len ( t . tokens ) == <NUM_LIT:5> </s>
