forked from GitHub/gf-core
bew BigLexEng (not ready)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,13 @@ mkOne s = case words s of
|
|||||||
nopar = filter (flip notElem "()")
|
nopar = filter (flip notElem "()")
|
||||||
mkCatf c r w = case c of
|
mkCatf c r w = case c of
|
||||||
"Noun" -> ["N","regN",w]
|
"Noun" -> ["N","regN",w]
|
||||||
|
"PRT" -> ["Adv","mkAdv",w] ----
|
||||||
|
"TITLE" -> ["N","regN",w] ----
|
||||||
"Adject" -> ["A","regA",w]
|
"Adject" -> ["A","regA",w]
|
||||||
|
"AdjInf" -> ["A","regA",w] ----
|
||||||
|
"AdjInf_LONG" -> ["A","longA",w] ----
|
||||||
|
"AdjPrd" -> ["A","regA",w] ----
|
||||||
|
"AdjPrd_LONG" -> ["A","longA",w] ----
|
||||||
"Adject_LONG" -> ["A","longA",w]
|
"Adject_LONG" -> ["A","longA",w]
|
||||||
"Verb" | r == "irreg" -> []
|
"Verb" | r == "irreg" -> []
|
||||||
"Verb" -> ["V","regV",w]
|
"Verb" -> ["V","regV",w]
|
||||||
@@ -25,7 +31,18 @@ mkOne s = case words s of
|
|||||||
"V2" -> ["V2","regV2", w]
|
"V2" -> ["V2","regV2", w]
|
||||||
"PNoun" -> ["PN","regPN",toUpper (head w): tail w]
|
"PNoun" -> ["PN","regPN",toUpper (head w): tail w]
|
||||||
'V':'2':'_':prep | r == "irreg" ->
|
'V':'2':'_':prep | r == "irreg" ->
|
||||||
["V2","mkV2", w, "_V", map toLower prep]
|
let p = map toLower prep in ["V2","mkV2_"++p, w, "_V", p]
|
||||||
x:'2':'_':prep -> [[x]++"2","prep" ++[x]++"2", w, map toLower prep]
|
x:'2':'_':prep ->
|
||||||
|
let p = map toLower prep in [[x]++"2","prep" ++[x]++"2"++p, w, p]
|
||||||
|
"V3_NP" | r == "irreg" -> ["V3","irreg", w, "_V"]
|
||||||
|
"V3_NP" -> ["V3","regV3", w]
|
||||||
|
'V':'3':'_':'P':'P':prep | r == "irreg" ->
|
||||||
|
let p = map toLower prep in ["V3","mkV3_"++p, w, "_V", p]
|
||||||
|
'V':'3':'_':'P':'P':prep ->
|
||||||
|
let p = map toLower prep in ["V3","mkV3_"++p, w, p]
|
||||||
|
'V':'3':'_':'S':_ | r == "irreg" -> ["V2","mkV2_S", w, "_V"] ----
|
||||||
|
'V':'3':'_':'S':_ -> ["V2","mkV2_S", w] ----
|
||||||
|
'V':'3':'_':_ -> ["V3","mkV3", w] ----
|
||||||
|
|
||||||
_ -> [c,"mk" ++ c, w]
|
_ -> [c,"mk" ++ c, w]
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
38
examples/big/postedit.hs
Normal file
38
examples/big/postedit.hs
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
import Char
|
||||||
|
import System
|
||||||
|
|
||||||
|
infile = "BigLexEng.gf"
|
||||||
|
tmp = "tm"
|
||||||
|
|
||||||
|
main = do
|
||||||
|
writeFile tmp ""
|
||||||
|
s <- readFile infile
|
||||||
|
mapM_ (appendFile tmp . mkOne) $ lines s --- $ chop s
|
||||||
|
system "mv tm BigLexEng.gf"
|
||||||
|
|
||||||
|
chop s = case s of
|
||||||
|
';':cs -> ";\n"++chop cs
|
||||||
|
c:cs -> c:chop cs
|
||||||
|
_ -> s
|
||||||
|
|
||||||
|
mkOne s = case words s of
|
||||||
|
lin:a2:eq:pa2:ws | take 6 pa2 == "prepA2" ->
|
||||||
|
unwords $ [lin,a2,eq,"prepA2"] ++ ws ++ ["\n"]
|
||||||
|
lin:a2:eq:pa2:ws | take 6 pa2 == "prepV2" ->
|
||||||
|
unwords $ [lin,a2,eq,"prepV2"] ++ ws ++ ["\n"]
|
||||||
|
lin:v2:eq:"mkV2":v:_:ws ->
|
||||||
|
unwords $ [lin,v2,eq,"mkV2",(read v ++ "_V")] ++ ws ++ ["\n"]
|
||||||
|
lin:v2:eq:"mkV3":v:_:ws ->
|
||||||
|
unwords $ [lin,v2,eq,"dirV3",(read v ++ "_V")] ++ ws ++ ["\n"]
|
||||||
|
lin:a2:eq:pa2:ws | take 4 pa2 == "mkV2" ->
|
||||||
|
unwords $ [lin,a2,eq,"mkV2"] ++ ws ++ ["\n"]
|
||||||
|
lin:a2:eq:pa2:ws | take 6 pa2 == "prepN2" ->
|
||||||
|
unwords $ [lin,a2,eq,"prepN2"] ++ ws ++ ["\n"]
|
||||||
|
lin:a2:eq:pa2:ws | take 4 pa2 == "mkV3" ->
|
||||||
|
unwords $ [lin,a2,eq,"mkV3"] ++ ws ++ ["\n"]
|
||||||
|
|
||||||
|
lin:v2:eq:"irreg":v:_:ws ->
|
||||||
|
unwords $ [lin,v2,eq,"dirV2",(read v ++ "_V")] ++ ws ++ ["\n"]
|
||||||
|
|
||||||
|
|
||||||
|
_ -> s ++ "\n"
|
||||||
Reference in New Issue
Block a user