mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 09:57:26 +03:00 
			
		
		
		
	* This PR adds Gujarati Language class along with - stop words * Add test for gu tokenizer
		
			
				
	
	
		
			21 lines
		
	
	
		
			763 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			763 B
		
	
	
	
		
			Python
		
	
	
	
	
	
# coding: utf-8
 | 
						|
from __future__ import unicode_literals
 | 
						|
 | 
						|
import pytest
 | 
						|
 | 
						|
def test_gu_tokenizer_handlers_long_text(gu_tokenizer):
 | 
						|
    text = """પશ્ચિમ ભારતમાં આવેલું ગુજરાત રાજ્ય જે વ્યક્તિઓની માતૃભૂમિ છે"""
 | 
						|
    tokens = gu_tokenizer(text)
 | 
						|
    assert len(tokens) == 9
 | 
						|
 | 
						|
@pytest.mark.parametrize(
 | 
						|
    "text,length",
 | 
						|
    [
 | 
						|
        ("ગુજરાતીઓ ખાવાના શોખીન માનવામાં આવે છે", 6),
 | 
						|
        ("ખેતરની ખેડ કરવામાં આવે છે.", 5),
 | 
						|
    ],
 | 
						|
)
 | 
						|
def test_gu_tokenizer_handles_cnts(gu_tokenizer, text, length):
 | 
						|
    tokens = gu_tokenizer(text)
 | 
						|
    assert len(tokens) == length
 |