CUNY-CL / latin_scansion

Apache License 2.0
0 stars 2 forks source link

Added some tests to scansion_tests.py #49

Closed jillianchang closed 3 years ago

jillianchang commented 3 years ago

This didn't happen before, but the grammar is now applying h-deletion and synezisis even when it's not necessary. Do you know why that's happening? The overapplied synizesis lines (test_aen_1_593 and test_aen_1_682) scanned properly when I tested the lines in the individual grammar files without using synizesis.

FAIL: test_aen_1_247 (__main__.ScansionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "scansion_test.py", line 65, in test_aen_1_247
    self.assertEqual(
AssertionError: 'iːk tame nillurbẽː patawiː seːdeːskwe lokaːwit' != 'hiːk tame nillurbẽː patawiː seːdeːskwe lokaːwit'
- iːk tame nillurbẽː patawiː seːdeːskwe lokaːwit
+ hiːk tame nillurbẽː patawiː seːdeːskwe lokaːwit
? +

======================================================================
FAIL: test_aen_1_254 (__main__.ScansionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "scansion_test.py", line 72, in test_aen_1_254
    self.assertEqual(
AssertionError: 'olliː subriːdeːns ominũː sato ratkwe deoːrũː' != 'olliː subriːdeːns hominũː sato ratkwe deoːrũː'
- olliː subriːdeːns ominũː sato ratkwe deoːrũː
+ olliː subriːdeːns hominũː sato ratkwe deoːrũː
?                   +

======================================================================
FAIL: test_aen_1_450 (__main__.ScansionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "scansion_test.py", line 79, in test_aen_1_450
    self.assertEqual(
AssertionError: 'oːk priːmin luːkoː nowa reːs oblaːta timoːrẽː' != 'hoːk priːmin luːkoː nowa reːs oblaːta timoːrẽː'
- oːk priːmin luːkoː nowa reːs oblaːta timoːrẽː
+ hoːk priːmin luːkoː nowa reːs oblaːta timoːrẽː
? +

======================================================================
FAIL: test_aen_1_477 (__main__.ScansionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "scansion_test.py", line 86, in test_aen_1_477
    self.assertEqual(
AssertionError: 'loːra teneːns tame nujk kerwiːkskwe komajkwe trauntur' != 'loːra teneːns tame nujk kerwiːkskwe komajkwe trahuntur'
- loːra teneːns tame nujk kerwiːkskwe komajkwe trauntur
+ loːra teneːns tame nujk kerwiːkskwe komajkwe trahuntur
?                                                 +

======================================================================
FAIL: test_aen_1_593 (__main__.ScansionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "scansion_test.py", line 93, in test_aen_1_593
    self.assertEqual(
AssertionError: 'argentũː parjuswe lapis kirkumdatu rawroː' != 'argentũː pariuswe lapis kirkumdatu rawroː'
- argentũː parjuswe lapis kirkumdatu rawroː
?             ^
+ argentũː pariuswe lapis kirkumdatu rawroː
?             ^

======================================================================
FAIL: test_aen_1_682 (__main__.ScansionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "scansion_test.py", line 107, in test_aen_1_682
    self.assertEqual(
AssertionError: 'neː kwaː skiːre doloːs medjuswokkurrere possit' != 'neː kwaː skiːre doloːs mediuswokkurrere possit'
- neː kwaː skiːre doloːs medjuswokkurrere possit
?                           ^
+ neː kwaː skiːre doloːs mediuswokkurrere possit
?                           ^

======================================================================
FAIL: test_aen_2_219 (__main__.ScansionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "scansion_test.py", line 139, in test_aen_2_219
    self.assertEqual(
AssertionError: 'bis medjampleksiː bis kolloː skwaːmea kirkũː' != 'bis mediampleksiː bis kolloː skwaːmea kirkũː'
- bis medjampleksiː bis kolloː skwaːmea kirkũː
?        ^
+ bis mediampleksiː bis kolloː skwaːmea kirkũː
?        ^

======================================================================
FAIL: test_aen_2_764 (__main__.ScansionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "scansion_test.py", line 176, in test_aen_2_764
    self.assertEqual(
AssertionError: '' != 'prajdadserwaːbant huːk undikwe troːia gazza'
+ prajdadserwaːbant huːk undikwe troːia gazza

======================================================================
FAIL: test_aen_3_161 (__main__.ScansionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "scansion_test.py", line 183, in test_aen_3_161
    self.assertEqual(
AssertionError: 'muːtandaj seːdeːs noːn ajk tibi liːtora swaːsit' != 'muːtandaj seːdeːs noːn hajk tibi liːtora swaːsit'
- muːtandaj seːdeːs noːn ajk tibi liːtora swaːsit
+ muːtandaj seːdeːs noːn hajk tibi liːtora swaːsit
kylebgorman commented 3 years ago

Could you check in the full set of examples? Some of the ones you mention aren't present in the PR.

kylebgorman commented 3 years ago

PS: I think what it produces for Aen. 2.219 is correct and you just have to make the test assertion conform, then remove the unittest.skip decorator. The same is true for Aen. 2.278.

jillianchang commented 3 years ago

Could you check in the full set of examples? Some of the ones you mention aren't present in the PR.

I think they are all in the PR, in the commit "added some tests" (2f4e3ef) - I think if you click the arrows on the left you can expand on the code to see all of it.

kylebgorman commented 3 years ago

Okay, now just Aen. 2.764 (That would be, I think, an error in Pharr himself we should probably correct) plus those two lines you are currently skipping. I assume the spurious h-deletion and synizesis is no longer happening on your end?

jillianchang commented 3 years ago

I’m still encountering the random h-deletion and synizesis. Lines 62-132 in the file (and line 183) contain those tests- are you able to see those?

2.764 actually scans fine because our pronoun citation grammar rewrites intervocalic “j”s, since we were under the assumption that he rewrote intervocalic “i”s as “j”s. So I think he took care of that poetic license aspect by preserving the “i” there.

kylebgorman commented 3 years ago

Can't replicate. All tests pass except 2.764.

[src]$ python scansion_test.py 
...............ssF..
======================================================================
FAIL: test_aen_2_764 (__main__.ScansionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "scansion_test.py", line 178, in test_aen_2_764
    self.assertEqual(
AssertionError: '' != 'prajdadserwaːbant huːk undikwe troːia gazza'
+ prajdadserwaːbant huːk undikwe troːia gazza

----------------------------------------------------------------------
Ran 20 tests in 0.019s

FAILED (failures=1, skipped=2)

I think you may need to recompile your all.far from scratch? It seems to be out of date somehow. (It's unlikely though not impossible that mine is out of date but also better somehow...)

jillianchang commented 3 years ago

To compile everything from scratch, I basically delete all far files and then do thraxmakedep all.grm?

kylebgorman commented 3 years ago

From the grammars directory:

  1. Delete all FAR files:
rm *.far
  1. Recompile:
make -j

thraxmakedep just generates the Makefile (the instructions for how to compile them), and in this case we don't need it at all since the Makefile is already fine.

jillianchang commented 3 years ago

Oh cool, so now all the tests passed for me, excluding the skipped diastole ones.