馬可夫演算法粵拼maa5 ho2 fu1 jin2 syun3 faat3英文Markov algorithm)係用咗類似形式文法嘅規則喺符號串上操作嘅字符串重寫系統。

例子 編輯

以下係一個馬可夫演算法嘅例子。

規則 編輯

  1. "A" -> "apple"(最先)
  2. "B" -> "bag"
  3. "S" -> "shop"
  4. "T" -> "the"
  5. "the shop" -> "my brother"
  6. "a never used" -> ."terminating rule"(最後)

輸入 編輯

"I bought a B of As from T S."

執行 編輯

如果段馬可夫演算法收到呢個輸入,段演算法會以以下嘅步驟改變串字:

  1. "I bought a B of As from T S."(開始)
  2. "I bought a B of apples from T S."
  3. "I bought a bag of apples from T S."
  4. "I bought a bag of apples from T shop."
  5. "I bought a bag of apples from the shop."
  6. "I bought a bag of apples from my brother."

然後段演算法終結。

睇埋 編輯