Last active
December 14, 2015 21:39
-
-
Save kmod-midori/5152636 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_tags = (raw)-> | |
return '' if raw is '' | |
return '' if !raw? | |
raw = raw.replace /☪|★|☆/g,'' | |
pattern = /\[(.+?)\]|【(.+?)\】|\((.+?)\)|『(.+?)\』|~(.+?)\~|◆(.+?)◇/g | |
tmp = raw.match(pattern) | |
if tmp? then tmp = for val in tmp | |
val[1...-1] | |
else tmp = [] | |
_raw = raw.replace(pattern,'').split(/\s+/g) | |
if _raw? and _raw.length >0 then for val in _raw | |
if val.replace /\s/g,'' is not val then tmp.push val | |
tmp = for tag in tmp | |
tag = tag.replace(/\s|&|&|&|\/|/|_|\|/g,' ') | |
tag = tag.split(/\s/g) | |
restore_english = (arr)-> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment