File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -163,14 +163,18 @@ mkMorphoDict env =
163163 _ | length (nub (map tail fls)) == length fls -> shrinkMore (map tail fls)
164164 _ -> fls
165165
166-
167- mkFun = showCId . mkCId . concat . intersperse " _"
166+ -- >>> mkFun ["hello", "world", "hello friends", "hello-all"]
167+ -- "hello_world_hello_friends_hello_all"
168+ mkFun :: [String ] -> String -- if word contains space or hyphen, replace with underscore
169+ mkFun = showCId . mkCId . concat . intersperse " _" . concatMap (words . removeHyphen)
170+ where
171+ removeHyphen [] = []
172+ removeHyphen [' -' ] = [' -' ] -- If hyphen is the last character, it's usually meaningful, leave it
173+ removeHyphen (' -' : cs) = ' ' : removeHyphen cs
174+ removeHyphen (c: cs) = c : removeHyphen cs
168175
169176quote s = " \" " ++ s ++ " \" "
170177
171-
172-
173-
174178{- ---- let us ignore this
175179 findCompounds :: [RuleData] -> [RuleData]
176180 findCompounds = getCompounds . sortOn cat_orthrevforms
You can’t perform that action at this time.
0 commit comments