mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-31 16:07:41 +03:00 
			
		
		
		
	Add regression test for #1547
This commit is contained in:
		
							parent
							
								
									2df27db671
								
							
						
					
					
						commit
						ee97fd3cb4
					
				
							
								
								
									
										17
									
								
								spacy/tests/regression/test_issue1547.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								spacy/tests/regression/test_issue1547.py
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| # coding: utf8 | ||||
| from __future__ import unicode_literals | ||||
| 
 | ||||
| import pytest | ||||
| 
 | ||||
| from ...vocab import Vocab | ||||
| from ...tokens import Doc, Span | ||||
| 
 | ||||
| 
 | ||||
| @pytest.mark.xfail | ||||
| def test_issue1547(): | ||||
|     """Test that entity labels still match after merging tokens.""" | ||||
|     words = ['\n', 'worda', '.', '\n', 'wordb', '-', 'Biosphere', '2', '-', ' \n'] | ||||
|     doc = Doc(Vocab(), words=words) | ||||
|     doc.ents = [Span(doc, 6, 8, label=doc.vocab.strings['PRODUCT'])] | ||||
|     doc[5:7].merge() | ||||
|     assert [ent.text for ent in doc.ents] | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user