def test_english_request(): """ Test case of starting server with Spanish defaults, and then requesting default English properties """ with corenlp.CoreNLPClient(properties='spanish', server_id='test_english_request') as client: ann = client.annotate(EN_DOC, properties_key='english', output_format='text') compare_ignoring_whitespace(ann, EN_DOC_GOLD)
def test_english_request(): """ Test case of starting server with Spanish defaults, and then requesting default English properties """ with corenlp.CoreNLPClient( properties='spanish', server_id='test_spanish_english_request') as client: ann = client.annotate(EN_DOC, properties='english', output_format='text') compare_ignoring_whitespace(ann, EN_DOC_GOLD) # Rerun the test with a server created in English mode to verify # that the expected output is what the defaults actually give us with corenlp.CoreNLPClient(properties='english', server_id='test_english_request') as client: ann = client.annotate(EN_DOC, output_format='text') compare_ignoring_whitespace(ann, EN_DOC_GOLD)
def test_lang_setting(corenlp_client): """ Test using a Stanford CoreNLP supported languages as a properties key """ ann = corenlp_client.annotate(GERMAN_DOC, properties="german", output_format="text") compare_ignoring_whitespace(ann, GERMAN_DOC_GOLD)