Skip to Main Content
Mathematica 錦囊妙計
book

Mathematica 錦囊妙計

by Sal Mangano
April 2014
Beginner to intermediate content levelBeginner to intermediate
830 pages
15h 21m
Chinese
GoTop Information, Inc.
Content preview from Mathematica 錦囊妙計
206
|
第五章
你可以對其他單字進行測試。[Page-206]
迴文(Palindrome
以下有趣的迴文單字範例來自 Mathematica 教學文件。
拼字檢查器
使用單字集搭配
Nearest[]
指令可建立簡易拼字檢查器。我們先使用
Nearest
指令預設
的距離函數;檢查器將根據輸入單字是否存在而輸出
True
False
,若不存在單字集
中,則輸出的第二個元素為拼字建議。
ch05.indd 206 2014/4/2 上午 06:13:18
5.7 使用內建單字集
|
207
(* 對下列函數提供一單字與一整數 n 作為引數時,將回傳 n 個與該單字接近的單字 *)
由上式輸出結果可見,預設的字串距離函數(
EditDistance
)並非最佳的拼字檢查器,
最明顯的答案
pickle
甚至沒有在內,你可以試著使用其他距離函數。以下建立的距離函
數將放大子音相異的距離,以輸出較合適的拼字建議。[Page-207]
以下測試幾個常見的拼錯字範例(來自牛津字典網頁:
http://bit.ly/KuIQ2
)。
本函數可輸出堪用的結果,但執行效率不佳。
ch05.indd 207 2014/4/2 上午 06:13:19
208
|
第五章
法(divide-and-conquer app
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ubuntu for Non-Geeks, 4th Edition

Ubuntu for Non-Geeks, 4th Edition

Rickford Grant, Phil Bull

Publisher Resources

ISBN: 9789863470106