mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 01:48:04 +03:00 
			
		
		
		
	Fix french lemmatization (#3180)
This commit is contained in:
		
							parent
							
								
									f9ca09caa0
								
							
						
					
					
						commit
						8bd85fd9d5
					
				| 
						 | 
					@ -131,7 +131,7 @@ def lemmatize(string, index, exceptions, rules):
 | 
				
			||||||
    if not forms:
 | 
					    if not forms:
 | 
				
			||||||
        forms.extend(oov_forms)
 | 
					        forms.extend(oov_forms)
 | 
				
			||||||
    if not forms and string in LOOKUP.keys():
 | 
					    if not forms and string in LOOKUP.keys():
 | 
				
			||||||
        forms.append(LOOKUP[string])
 | 
					        forms.append(LOOKUP[string][0])
 | 
				
			||||||
    if not forms:
 | 
					    if not forms:
 | 
				
			||||||
        forms.append(string)
 | 
					        forms.append(string)
 | 
				
			||||||
    return list(set(forms))
 | 
					    return list(set(forms))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										10
									
								
								spacy/tests/regression/test_issue3178.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								spacy/tests/regression/test_issue3178.py
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,10 @@
 | 
				
			||||||
 | 
					from __future__ import unicode_literals
 | 
				
			||||||
 | 
					import pytest
 | 
				
			||||||
 | 
					import spacy
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.mark.models('fr')
 | 
				
			||||||
 | 
					def test_issue1959(FR):
 | 
				
			||||||
 | 
					    texts = ['Je suis la mauvaise herbe', "Me, myself and moi"]
 | 
				
			||||||
 | 
					    for text in texts:
 | 
				
			||||||
 | 
					        FR(text)
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user