mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 09:57:26 +03:00 
			
		
		
		
	Update test for 850, making it work with matcher2
This commit is contained in:
		
							parent
							
								
									9bdfa5cd4f
								
							
						
					
					
						commit
						dcd8d89aef
					
				| 
						 | 
					@ -4,9 +4,9 @@ import pytest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ...vocab import Vocab
 | 
					from ...vocab import Vocab
 | 
				
			||||||
from ...tokens import Doc
 | 
					from ...tokens import Doc
 | 
				
			||||||
from ...matcher import Matcher
 | 
					from ...matcher2 import Matcher
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.mark.xfail
 | 
					#@pytest.mark.xfail
 | 
				
			||||||
def test_issue1945():
 | 
					def test_issue1945():
 | 
				
			||||||
    text = "a a a"
 | 
					    text = "a a a"
 | 
				
			||||||
    matcher = Matcher(Vocab())
 | 
					    matcher = Matcher(Vocab())
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
from __future__ import unicode_literals
 | 
					from __future__ import unicode_literals
 | 
				
			||||||
import pytest
 | 
					import pytest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ...matcher import Matcher
 | 
					from ...matcher2 import Matcher
 | 
				
			||||||
from ...vocab import Vocab
 | 
					from ...vocab import Vocab
 | 
				
			||||||
from ...attrs import LOWER
 | 
					from ...attrs import LOWER
 | 
				
			||||||
from ...tokens import Doc
 | 
					from ...tokens import Doc
 | 
				
			||||||
| 
						 | 
					@ -22,10 +22,9 @@ def test_basic_case():
 | 
				
			||||||
    assert end == 4
 | 
					    assert end == 4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.mark.xfail
 | 
					 | 
				
			||||||
def test_issue850():
 | 
					def test_issue850():
 | 
				
			||||||
    """The problem here is that the variable-length pattern matches the
 | 
					    """The variable-length pattern matches the
 | 
				
			||||||
    succeeding token. We then don't handle the ambiguity correctly."""
 | 
					    succeeding token. Check we handle the ambiguity correctly."""
 | 
				
			||||||
    matcher = Matcher(Vocab(
 | 
					    matcher = Matcher(Vocab(
 | 
				
			||||||
                lex_attr_getters={LOWER: lambda string: string.lower()}))
 | 
					                lex_attr_getters={LOWER: lambda string: string.lower()}))
 | 
				
			||||||
    IS_ANY_TOKEN = matcher.vocab.add_flag(lambda x: True)
 | 
					    IS_ANY_TOKEN = matcher.vocab.add_flag(lambda x: True)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user