from pytest import skip

from src.service.bert_word_segmenter import BertWordSegmenter


def test_segment():
    skip()
    segmenter = BertWordSegmenter()
    text = "今天天气不错，适合出去游玩"
    result = segmenter.segment(text)

    assert isinstance(result, dict)
    assert "output" in result
    assert len(result["output"]) > 0
    assert result["output"][0] == "今天"
    assert result["output"][1] == "天气"
    assert result["output"][2] == "不错"
    assert result["output"][3] == "，"
    assert result["output"][4] == "适合"
    assert result["output"][5] == "出去"
    assert result["output"][6] == "游玩"
