forked from GitHub/gf-core
resource synopsis
This commit is contained in:
10
index.html
10
index.html
@@ -58,6 +58,16 @@ December 22, 2006.
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
<i>June 27, 2007</i>. GF 2.8 forthcoming next week. Some highlights:
|
||||||
|
<ul>
|
||||||
|
<li> Resource Grammar Library v 1.2: <a href="lib/resource-1.0/doc/synopsis.html">synopsis</a>.
|
||||||
|
<li> new speech formats
|
||||||
|
<li> better semantics of <tt>variants</tt>
|
||||||
|
<li> lots of bug fixes
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
|
||||||
<i>December 22, 2006</i>. GF 2.7 released. Some highlights:
|
<i>December 22, 2006</i>. GF 2.7 released. Some highlights:
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ incomplete resource Constructors = open Grammar in {
|
|||||||
|
|
||||||
-- A text can also be empty.
|
-- A text can also be empty.
|
||||||
|
|
||||||
emptyText : Text ; -- 8. [empty text]
|
emptyText : Text ; -- 8. (empty text)
|
||||||
|
|
||||||
|
|
||||||
--3 Punct: punctuation marks
|
--3 Punct: punctuation marks
|
||||||
@@ -194,7 +194,7 @@ incomplete resource Constructors = open Grammar in {
|
|||||||
|
|
||||||
singularImpForm : ImpForm ; -- (help yourself) [default]
|
singularImpForm : ImpForm ; -- (help yourself) [default]
|
||||||
pluralImpForm : ImpForm ; -- (help yourselves)
|
pluralImpForm : ImpForm ; -- (help yourselves)
|
||||||
politeImpForm : ImpForm ; -- (help yourself) [polite singular]
|
politeImpForm : ImpForm ; -- (help yourself) (polite singular)
|
||||||
|
|
||||||
|
|
||||||
--2 Sentences and clauses
|
--2 Sentences and clauses
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
synopsis:
|
||||||
|
runghc MkSynopsis.hs
|
||||||
clt:
|
clt:
|
||||||
txt2tags clt2006.txt
|
txt2tags clt2006.txt
|
||||||
htmls clt2006.html
|
htmls clt2006.html
|
||||||
|
|||||||
78
lib/resource-1.0/doc/MkSynopsis.hs
Normal file
78
lib/resource-1.0/doc/MkSynopsis.hs
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
import System
|
||||||
|
import Char
|
||||||
|
|
||||||
|
main = do
|
||||||
|
writeFile synopsis "GF Resource Grammar Library: Synopsis"
|
||||||
|
append "Aarne Ranta"
|
||||||
|
space
|
||||||
|
title "Syntax"
|
||||||
|
space
|
||||||
|
link "source" syntaxAPI
|
||||||
|
space
|
||||||
|
rs <- getRules syntaxAPI
|
||||||
|
delimit rs
|
||||||
|
space
|
||||||
|
mapM_ putParadigms paradigmFiles
|
||||||
|
system $ "txt2tags -thtml --toc " ++ synopsis
|
||||||
|
|
||||||
|
|
||||||
|
getRules file = do
|
||||||
|
ss <- readFile file >>= return . lines
|
||||||
|
return $ mkTable $ getrs [] ss
|
||||||
|
where
|
||||||
|
getrs rs ss = case ss of
|
||||||
|
('-':'-':'.':_):_ -> reverse rs
|
||||||
|
[] -> reverse rs
|
||||||
|
('-':'-':_):ss2 -> getrs rs ss2
|
||||||
|
s:ss2 -> case words s of
|
||||||
|
_:_:"overload":_ -> getrs rs ss2
|
||||||
|
_:":":_ -> getrs (layout s:rs) ss2
|
||||||
|
_ -> getrs rs ss2
|
||||||
|
|
||||||
|
putParadigms (lang,file) = do
|
||||||
|
title ("Paradigms for " ++ lang)
|
||||||
|
space
|
||||||
|
link "source" file
|
||||||
|
space
|
||||||
|
rs <- getRules file
|
||||||
|
space
|
||||||
|
delimit rs
|
||||||
|
space
|
||||||
|
|
||||||
|
layout s = " " ++ dropWhile isSpace s
|
||||||
|
|
||||||
|
|
||||||
|
mkTable rs = "|| Function | Type | Example ||" : map (unwords . row . words) rs where
|
||||||
|
row ws = ["|", name, "|", typ, "|", ex, "|"] where
|
||||||
|
name = ttf (head ws)
|
||||||
|
(t,e) = span (/="--") (tail ws)
|
||||||
|
typ = ttf (unwords $ filtype (drop 1 t))
|
||||||
|
ex = if null e then "-" else itf (unwords $ unnumber $ drop 1 e)
|
||||||
|
unnumber e = case e of
|
||||||
|
n:ws | last n == '.' && not (null (init n)) && all isDigit (init n) -> ws
|
||||||
|
_ -> e
|
||||||
|
filtype = filter (/=";")
|
||||||
|
|
||||||
|
synopsis = "synopsis.txt"
|
||||||
|
syntaxAPI = "../api/Constructors.gf"
|
||||||
|
paradigmFiles = [
|
||||||
|
("Danish", "../danish/ParadigmsDan.gf"),
|
||||||
|
("English", "../english/ParadigmsEng.gf"),
|
||||||
|
("Finnish", "../finnish/ParadigmsFin.gf"),
|
||||||
|
("French", "../french/ParadigmsFre.gf"),
|
||||||
|
("German", "../german/ParadigmsGer.gf"),
|
||||||
|
("Italian", "../italian/ParadigmsIta.gf"),
|
||||||
|
("Norwegian", "../norwegian/ParadigmsNor.gf"),
|
||||||
|
("Russian", "../russian/ParadigmsRus.gf"),
|
||||||
|
("Spanish", "../spanish/ParadigmsSpa.gf"),
|
||||||
|
("Swedish", "../swedish/ParadigmsSwe.gf")
|
||||||
|
]
|
||||||
|
|
||||||
|
append s = appendFile synopsis ('\n':s)
|
||||||
|
title s = append $ "=" ++ s ++ "="
|
||||||
|
space = append "\n"
|
||||||
|
delimit ss = mapM_ append ss
|
||||||
|
link s f = append $ "[" ++ s ++ " " ++ f ++ "]"
|
||||||
|
|
||||||
|
ttf s = "``" ++ s ++ "``"
|
||||||
|
itf s = "//" ++ s ++ "//"
|
||||||
4354
lib/resource-1.0/doc/synopsis.html
Normal file
4354
lib/resource-1.0/doc/synopsis.html
Normal file
File diff suppressed because it is too large
Load Diff
@@ -89,8 +89,7 @@ oper
|
|||||||
mkN : (talo : Str) -> N ;
|
mkN : (talo : Str) -> N ;
|
||||||
mkN : (savi,savia : Str) -> N ;
|
mkN : (savi,savia : Str) -> N ;
|
||||||
mkN : (vesi,veden,vesiä : Str) -> N ;
|
mkN : (vesi,veden,vesiä : Str) -> N ;
|
||||||
mkN : (talo, talon, talona, taloa, taloon,
|
mkN : (olo,oln,olona,oloa,oloon,oloina,oloissa,olojen,oloja,oloihin : Str) -> N
|
||||||
taloina,taloissa,talojen,taloja,taloihin : Str) -> N
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
@@ -243,8 +242,7 @@ oper
|
|||||||
mkV : (soutaa : Str) -> V ;
|
mkV : (soutaa : Str) -> V ;
|
||||||
mkV : (soutaa,souti : Str) -> V ;
|
mkV : (soutaa,souti : Str) -> V ;
|
||||||
mkV : (soutaa,soudan,souti : Str) -> V ;
|
mkV : (soutaa,soudan,souti : Str) -> V ;
|
||||||
mkV : (tulla,tulee,tulen,tulevat,tulkaa,tullaan,
|
mkV : (tulla,tulee,tulen,tulevat,tulkaa,tullaan,tuli,tulin,tulisi,tullut,tultu,tullun : Str) -> V ;
|
||||||
tuli,tulin,tulisi,tullut,tultu,tullun : Str) -> V ;
|
|
||||||
|
|
||||||
-- The subject case of verbs is by default nominative. This function can change it.
|
-- The subject case of verbs is by default nominative. This function can change it.
|
||||||
|
|
||||||
|
|||||||
@@ -210,8 +210,7 @@ oper
|
|||||||
-- to consult, here is a worst-case function for "-ire" and "-ere" verbs,
|
-- to consult, here is a worst-case function for "-ire" and "-ere" verbs,
|
||||||
-- taking 11 arguments.
|
-- taking 11 arguments.
|
||||||
|
|
||||||
mkV :
|
mkV : (udire,odo,ode,udiamo,udiro,udii,udisti,udi,udirono,odi,udito : Str) -> V
|
||||||
(udire,odo,ode,udiamo,udiro,udii,udisti,udi,udirono,odi,udito : Str) -> V
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- The function $regV$ gives all verbs the compound auxiliary "avere".
|
-- The function $regV$ gives all verbs the compound auxiliary "avere".
|
||||||
|
|||||||
Reference in New Issue
Block a user