Skip to content

Instantly share code, notes, and snippets.

@MagicSword
Created November 4, 2019 19:10
Show Gist options
  • Select an option

  • Save MagicSword/c28ab2cf8000f7274b6b79a589cf27dd to your computer and use it in GitHub Desktop.

Select an option

Save MagicSword/c28ab2cf8000f7274b6b79a589cf27dd to your computer and use it in GitHub Desktop.

Revisions

  1. MagicSword created this gist Nov 4, 2019.
    17 changes: 17 additions & 0 deletions jieba-default-mode.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #encoding=utf-8
    import jieba

    sentence = "可以傳遞訊息也是一種節奏樂器在台灣無論是神將團八家將官將首布袋戲這些傳統藝陣技藝項目還是紅白喜事民俗活動鼓聲都是不可或缺的重要元素今天咱們要
    跟著祖傳三代的製鼓世家來講鼓」,早的故事製鼓的辛苦聽鼓聲傳千里振作精神勇往直前"
    print("Input:", sentence)
    words = jieba.cut(sentence, cut_all=False)
    print("Output 精確模式 Full Mode:")
    for word in words:
    print(word)

    sentence = "独立音乐需要大家一起来推广,欢迎加入我们的行列!"
    print("Input:", sentence)
    words = jieba.cut(sentence, cut_all=False)
    print("Output 精確模式 Full Mode:")
    for word in words:
    print(word)