mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
resource synopsis
This commit is contained in:
10
index.html
10
index.html
@@ -58,6 +58,16 @@ December 22, 2006.
|
||||
|
||||
<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:
|
||||
<ul>
|
||||
|
||||
@@ -82,7 +82,7 @@ incomplete resource Constructors = open Grammar in {
|
||||
|
||||
-- A text can also be empty.
|
||||
|
||||
emptyText : Text ; -- 8. [empty text]
|
||||
emptyText : Text ; -- 8. (empty text)
|
||||
|
||||
|
||||
--3 Punct: punctuation marks
|
||||
@@ -194,7 +194,7 @@ incomplete resource Constructors = open Grammar in {
|
||||
|
||||
singularImpForm : ImpForm ; -- (help yourself) [default]
|
||||
pluralImpForm : ImpForm ; -- (help yourselves)
|
||||
politeImpForm : ImpForm ; -- (help yourself) [polite singular]
|
||||
politeImpForm : ImpForm ; -- (help yourself) (polite singular)
|
||||
|
||||
|
||||
--2 Sentences and clauses
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
synopsis:
|
||||
runghc MkSynopsis.hs
|
||||
clt:
|
||||
txt2tags clt2006.txt
|
||||
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 : (savi,savia : Str) -> N ;
|
||||
mkN : (vesi,veden,vesiä : Str) -> N ;
|
||||
mkN : (talo, talon, talona, taloa, taloon,
|
||||
taloina,taloissa,talojen,taloja,taloihin : Str) -> N
|
||||
mkN : (olo,oln,olona,oloa,oloon,oloina,oloissa,olojen,oloja,oloihin : Str) -> N
|
||||
} ;
|
||||
|
||||
|
||||
@@ -243,8 +242,7 @@ oper
|
||||
mkV : (soutaa : Str) -> V ;
|
||||
mkV : (soutaa,souti : Str) -> V ;
|
||||
mkV : (soutaa,soudan,souti : Str) -> V ;
|
||||
mkV : (tulla,tulee,tulen,tulevat,tulkaa,tullaan,
|
||||
tuli,tulin,tulisi,tullut,tultu,tullun : Str) -> V ;
|
||||
mkV : (tulla,tulee,tulen,tulevat,tulkaa,tullaan,tuli,tulin,tulisi,tullut,tultu,tullun : Str) -> V ;
|
||||
|
||||
-- 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,
|
||||
-- taking 11 arguments.
|
||||
|
||||
mkV :
|
||||
(udire,odo,ode,udiamo,udiro,udii,udisti,udi,udirono,odi,udito : Str) -> V
|
||||
mkV : (udire,odo,ode,udiamo,udiro,udii,udisti,udi,udirono,odi,udito : Str) -> V
|
||||
} ;
|
||||
|
||||
-- The function $regV$ gives all verbs the compound auxiliary "avere".
|
||||
|
||||
Reference in New Issue
Block a user