From 734d1da55cc795f9bed7f50588ffb5402261b42a Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 21 Dec 2014 20:43:27 +1100 Subject: [PATCH] * Upd emoticons test --- tests/test_emoticons.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/test_emoticons.py b/tests/test_emoticons.py index 143be607d..10346b252 100644 --- a/tests/test_emoticons.py +++ b/tests/test_emoticons.py @@ -1,10 +1,16 @@ from __future__ import unicode_literals +import pytest -from spacy.en import EN +from spacy.en import English -def test_tweebo_challenge(): + +@pytest.fixture +def EN(): + return English(pos_tag=False) + +def test_tweebo_challenge(EN): text = u""":o :/ :'( >:o (: :) >.< XD -__- o.O ;D :-) @_@ :P 8D :1 >:( :D =| ") :> ....""" - tokens = EN.tokenize(text) + tokens = EN(text) assert tokens[0].string == ":o" assert tokens[1].string == ":/" assert tokens[2].string == ":'(" @@ -29,7 +35,7 @@ def test_tweebo_challenge(): assert tokens[21].string == '....' -def test_false_positive(): +def test_false_positive(EN): text = "example:)" - tokens = EN.tokenize(text) + tokens = EN(text) assert len(tokens) == 3