Skip to content

Commit

Permalink
Turkish test typo fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
goker-dev committed Dec 3, 2017
1 parent 8babfdd commit f170bd8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
import sys
from afinn import Afinn

# https://stackoverflow.com/questions/6625782
if sys.version_info[0] == 2:
import codecs

u = lambda s: codecs.unicode_escape_decode(s)[0]
elif sys.version_info[0] == 3:
u = lambda s: s

afinn = Afinn(language='tr')
score = afinn.score('kar')
print score

score = afinn.score(u('\xe7ok iyi'))
print score

print u('i\u011Fren\u00E7')
score = afinn.score(u('i\u011Fren\u00E7'))
print score
score = afinn.score(u('iğrenç'))
print score
4 changes: 2 additions & 2 deletions tests/test_afinn.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def test_turkish():

score = afinn.score(u('\xe7ok iyi'))
assert score > 0

score = afinn.score(u('i\u011Fre\u00E7'))
score = afinn.score(u('i\u011Fren\u00E7'))
assert score < 0


Expand Down

0 comments on commit f170bd8

Please sign in to comment.