mirror of
https://github.com/koreader/koreader
synced 2024-11-16 06:12:56 +00:00
07586cea71
This should fix #1337.
12 lines
317 B
Lua
12 lines
317 B
Lua
|
|
local util = {}
|
|
|
|
function util.stripePunctuations(word)
|
|
if not word then return end
|
|
-- strip ASCII punctuation characters around word
|
|
-- and strip any generic punctuation (U+2000 - U+206F) in the word
|
|
return word:gsub("\226[\128-\131][\128-\191]",''):gsub("^%p+",''):gsub("%p+$",'')
|
|
end
|
|
|
|
return util
|