Skip to content

Commit

Permalink
Added folia test for sentiments (issue proycon/folia#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Aug 11, 2016
1 parent f472b01 commit 3d781ef
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/folia.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,17 @@ def test048_observations(self):
self.assertEqual( observation.cls , "ei_ij_error")
self.assertEqual( observation.description() , "Confusion between EI and IJ diphtongues")

def test049_sentiment(self):
"""Sanity check - Sentiments"""
sentence = self.doc['WR-P-E-J-0000000001.sandbox.2.s.3']
sentiments = sentence.annotation(folia.SentimentLayer)
sentiment = sentiments.annotation(folia.Sentiment)
self.assertEqual( sentiment.cls , "disappointment")
self.assertEqual( sentiment.feat('polarity') , "negative")
self.assertEqual( sentiment.feat('strength') , "strong")
self.assertEqual( sentiment.annotation(folia.Source).text(), "Hij")
self.assertEqual( sentiment.annotation(folia.Headspan).text(), "erg teleurgesteld")

def test099_write(self):
"""Sanity Check - Writing to file"""
self.doc.save('/tmp/foliasavetest.xml')
Expand Down

0 comments on commit 3d781ef

Please sign in to comment.