Example #1
0
def test_simplified_remote_action_reference():
    pipeline = Pipeline.from_text('hello')
    pipeline.add_step('kodexa/ner-tagger', options={"option": "test"})

    assert len(pipeline.steps) == 1
    assert isinstance(pipeline.steps[0].step, RemoteStep)
    assert "option" in pipeline.steps[0].step.options
Example #2
0
def test_basic_text_pipeline():
    text = 'The Normans (Norman: Nourmands; French: Normands; Latin: Normanni) ' \
           'were the people who in the 10th and 11th centuries gave their name to ' \
           'Normandy, a region in France. They were descended from Norse ' \
           '(\"Norman\" comes from \"Norseman\") raiders and pirates from Denmark, ' \
           'Iceland and Norway who, under their leader Rollo, ' \
           'agreed to swear fealty to King Charles III of West Francia. ' \
           'Through generations of assimilation and mixing with the native ' \
           'Frankish and Roman-Gaulish populations, their descendants would gradually ' \
           'merge with the Carolingian-based cultures of West Francia. ' \
           'The distinct cultural and ethnic identity of the Normans emerged initially ' \
           'in the first half of the 10th century, ' \
           'and it continued to evolve over the succeeding centuries.'
    pipeline = Pipeline.from_text(text)
    pipeline.run()
    doc = pipeline.context.output_document

    assert len(doc.get_root().get_all_content()) == 742