mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
unlexer bug ; "vilka" ; lib path warning ; p -lines result
This commit is contained in:
@@ -29,7 +29,7 @@ multimodal:
|
||||
mv multimodal/*.gfc multimodal/*.gfr ../multimodal
|
||||
|
||||
compiled:
|
||||
cd .. ; tar cvfz compiled.tgz alltenses/ mathematical/ multimodal/ present/
|
||||
cd .. ; tar cvfz compiled.tgz alltenses/ mathematical/ multimodal/ present/ prelude/*.gf?
|
||||
|
||||
treebank:
|
||||
gf <mkTreebank.gfs
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<P ALIGN="center"><CENTER><H1>GF Resource Grammar Library v. 1.0</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Author: Aarne Ranta <aarne (at) cs.chalmers.se></I><BR>
|
||||
Last update: Fri Mar 10 13:27:21 2006
|
||||
Last update: Tue Mar 21 14:49:24 2006
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
@@ -35,7 +35,8 @@ Last update: Fri Mar 10 13:27:21 2006
|
||||
<LI><A HREF="#toc14">Tram</A>
|
||||
<LI><A HREF="#toc15">Animals</A>
|
||||
</UL>
|
||||
<LI><A HREF="#toc16">More reading</A>
|
||||
<LI><A HREF="#toc16">Known bugs and missing components</A>
|
||||
<LI><A HREF="#toc17">More reading</A>
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
@@ -60,9 +61,12 @@ we refer to <A HREF="../../resource/">v. 0.9</A>.
|
||||
<A NAME="toc1"></A>
|
||||
<H2>Authors</H2>
|
||||
<P>
|
||||
Inger Andersson and Therese Soderberg (Spanish morphology),
|
||||
Nicolas Barth and Sylvain Pogodalla (French verb list),
|
||||
Janna Khegai (Russian modules, forthcoming),
|
||||
Bjorn Bringert (many Swadesh lexica),
|
||||
Carlos Gonzalia (Spanish cardinals),
|
||||
Harald Hammarstrom (German morphology),
|
||||
Partik Jansson (Swedish cardinals),
|
||||
Aarne Ranta.
|
||||
</P>
|
||||
@@ -70,12 +74,16 @@ Aarne Ranta.
|
||||
We are grateful for contributions and
|
||||
comments to several other people who have used this and
|
||||
the previous versions of the resource library, including
|
||||
Ludmilla Bogavac,
|
||||
Ana Bove,
|
||||
David Burke,
|
||||
Lauri Carlson,
|
||||
Gloria Casanellas,
|
||||
Karin Cavallin,
|
||||
Robin Cooper,
|
||||
Hans-Joachim Daniels,
|
||||
Elisabet Engdahl,
|
||||
Markus Forsberg,
|
||||
Kristofer Johannisson,
|
||||
Anni Laine,
|
||||
Wanjiku Ng'ang'a,
|
||||
@@ -130,15 +138,26 @@ Go to the main directory, compile the grammars, and run a test.
|
||||
</PRE>
|
||||
<P>
|
||||
This will take quite some time. An alternative is to use the
|
||||
<A HREF="../../compiled.tgz">precompiled grammar package</A>. Just do
|
||||
precompiled grammar package from GF download page. This package
|
||||
has the necessary <CODE>gfc</CODE> and <CODE>gfr</CODE> files directly under <CODE>GF/lib</CODE>.
|
||||
</P>
|
||||
<PRE>
|
||||
cd GF/lib/resource-1.0
|
||||
make pretest
|
||||
GF/lib/alltenses
|
||||
GF/lib/mathematical
|
||||
GF/lib/multimodal
|
||||
GF/lib/present
|
||||
</PRE>
|
||||
<P>
|
||||
For more examples, see the
|
||||
<A HREF="clt2006.html">Overview slides</A>.
|
||||
Do for instance
|
||||
</P>
|
||||
<PRE>
|
||||
cd GF/lib/
|
||||
gf
|
||||
> i -path=present:prelude present/LangEng.gfc
|
||||
> gr -cat=S -number=3 -cf | tb
|
||||
</PRE>
|
||||
<P>
|
||||
For more examples, see the <A HREF="clt2006.html">Overview slides</A>.
|
||||
</P>
|
||||
<A NAME="toc5"></A>
|
||||
<H3>The language independent ground API</H3>
|
||||
@@ -328,6 +347,84 @@ Its purpose is to serve as a prototype for example-based
|
||||
grammar writing.
|
||||
</P>
|
||||
<A NAME="toc16"></A>
|
||||
<H2>Known bugs and missing components</H2>
|
||||
<P>
|
||||
This bugs should be fixed before the final release of v. 1.0.
|
||||
</P>
|
||||
<P>
|
||||
Danish
|
||||
</P>
|
||||
<UL>
|
||||
<LI>API 1.0 not implemented
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
English
|
||||
</P>
|
||||
<UL>
|
||||
<LI>only contracted negation forms
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Finnish
|
||||
</P>
|
||||
<UL>
|
||||
<LI>no possessive suffixes
|
||||
<LI>wrong cases in passive constructions
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
French
|
||||
</P>
|
||||
<UL>
|
||||
<LI>only direct word order in questions
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
German
|
||||
</P>
|
||||
<UL>
|
||||
<LI>the Swadesh part of lexicon missing
|
||||
<LI>no list of irregular verbs
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Italian
|
||||
</P>
|
||||
<UL>
|
||||
<LI>no contraction of infinitives before clitics
|
||||
<LI>no list of irregular verbs
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Norwegian
|
||||
</P>
|
||||
<UL>
|
||||
<LI>word order in compound verbs sometimes wrong
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Russian
|
||||
</P>
|
||||
<UL>
|
||||
<LI>API 1.0 not implemented
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Spanish
|
||||
</P>
|
||||
<UL>
|
||||
<LI>no ordinal numbers
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Swedish
|
||||
</P>
|
||||
<UL>
|
||||
<LI>word order in compound verbs sometimes wrong
|
||||
</UL>
|
||||
|
||||
<A NAME="toc17"></A>
|
||||
<H2>More reading</H2>
|
||||
<P>
|
||||
<A HREF="gslt-sem-2006.html">Grammars as Software Libraries</A>. Slides
|
||||
|
||||
@@ -25,21 +25,28 @@ we refer to [v. 0.9 ../../resource/].
|
||||
|
||||
==Authors==
|
||||
|
||||
Inger Andersson and Therese Soderberg (Spanish morphology),
|
||||
Nicolas Barth and Sylvain Pogodalla (French verb list),
|
||||
Janna Khegai (Russian modules, forthcoming),
|
||||
Bjorn Bringert (many Swadesh lexica),
|
||||
Carlos Gonzalia (Spanish cardinals),
|
||||
Harald Hammarstrom (German morphology),
|
||||
Partik Jansson (Swedish cardinals),
|
||||
Aarne Ranta.
|
||||
|
||||
We are grateful for contributions and
|
||||
comments to several other people who have used this and
|
||||
the previous versions of the resource library, including
|
||||
Ludmilla Bogavac,
|
||||
Ana Bove,
|
||||
David Burke,
|
||||
Lauri Carlson,
|
||||
Gloria Casanellas,
|
||||
Karin Cavallin,
|
||||
Robin Cooper,
|
||||
Hans-Joachim Daniels,
|
||||
Elisabet Engdahl,
|
||||
Markus Forsberg,
|
||||
Kristofer Johannisson,
|
||||
Anni Laine,
|
||||
Wanjiku Ng'ang'a,
|
||||
@@ -83,13 +90,22 @@ Go to the main directory, compile the grammars, and run a test.
|
||||
make test
|
||||
```
|
||||
This will take quite some time. An alternative is to use the
|
||||
[precompiled grammar package ../../compiled.tgz]. Just do
|
||||
precompiled grammar package from GF download page. This package
|
||||
has the necessary ``gfc`` and ``gfr`` files directly under ``GF/lib``.
|
||||
```
|
||||
cd GF/lib/resource-1.0
|
||||
make pretest
|
||||
GF/lib/alltenses
|
||||
GF/lib/mathematical
|
||||
GF/lib/multimodal
|
||||
GF/lib/present
|
||||
```
|
||||
For more examples, see the
|
||||
[Overview slides clt2006.html].
|
||||
Do for instance
|
||||
```
|
||||
cd GF/lib/
|
||||
gf
|
||||
> i -path=present:prelude present/LangEng.gfc
|
||||
> gr -cat=S -number=3 -cf | tb
|
||||
```
|
||||
For more examples, see the [Overview slides clt2006.html].
|
||||
|
||||
|
||||
|
||||
@@ -265,6 +281,54 @@ Its purpose is to serve as a prototype for example-based
|
||||
grammar writing.
|
||||
|
||||
|
||||
==Known bugs and missing components==
|
||||
|
||||
This bugs should be fixed before the final release of v. 1.0.
|
||||
|
||||
Danish
|
||||
- API 1.0 not implemented
|
||||
|
||||
|
||||
English
|
||||
- only contracted negation forms
|
||||
|
||||
|
||||
Finnish
|
||||
- no possessive suffixes
|
||||
- wrong cases in passive constructions
|
||||
|
||||
|
||||
French
|
||||
- only direct word order in questions
|
||||
|
||||
|
||||
German
|
||||
- the Swadesh part of lexicon missing
|
||||
- no list of irregular verbs
|
||||
|
||||
|
||||
Italian
|
||||
- no contraction of infinitives before clitics
|
||||
- no list of irregular verbs
|
||||
|
||||
|
||||
Norwegian
|
||||
- word order in compound verbs sometimes wrong
|
||||
|
||||
|
||||
Russian
|
||||
- API 1.0 not implemented
|
||||
|
||||
|
||||
Spanish
|
||||
- no ordinal numbers
|
||||
|
||||
|
||||
Swedish
|
||||
- word order in compound verbs sometimes wrong
|
||||
|
||||
|
||||
|
||||
==More reading==
|
||||
|
||||
[Grammars as Software Libraries gslt-sem-2006.html]. Slides
|
||||
|
||||
@@ -107,7 +107,7 @@ concrete StructuralNor of Structural = CatNor **
|
||||
whichPl_IDet = {s = \\_ => "hvilke" ; n = Pl ; det = DIndef} ;
|
||||
whichSg_IDet = {s = genderForms "hvilken" "hvilket" ; n = Sg ; det = DIndef} ;
|
||||
whoSg_IP = {s = vem.s ; gn = SgUtr} ;
|
||||
whoPl_IP = {s = vem.s ; gn = Plg} ;
|
||||
whoPl_IP = {s = \\_ => "hvilke" ; gn = Plg} ;
|
||||
why_IAdv = ss "hvorfor" ;
|
||||
without_Prep = ss "uten" ;
|
||||
with_Prep = ss "med" ;
|
||||
|
||||
@@ -106,7 +106,7 @@ concrete StructuralSwe of Structural = CatSwe **
|
||||
whichPl_IDet = {s = \\_ => "vilka" ; n = Pl ; det = DIndef} ;
|
||||
whichSg_IDet = {s = genderForms "vilken" "vilket" ; n = Sg ; det = DIndef} ;
|
||||
whoSg_IP = {s = vem.s ; gn = SgUtr} ;
|
||||
whoPl_IP = {s = vem.s ; gn = Plg} ;
|
||||
whoPl_IP = {s = \\_ => "vilka" ; gn = Plg} ;
|
||||
why_IAdv = ss "varför" ;
|
||||
without_Prep = ss "utan" ;
|
||||
with_Prep = ss "med" ;
|
||||
|
||||
20
src/GF.hs
20
src/GF.hs
@@ -31,11 +31,11 @@ import GF.Text.UTF8
|
||||
|
||||
import GF.Today (today,version)
|
||||
import GF.System.Arch
|
||||
import System (getArgs,system)
|
||||
import System (getArgs,system,getEnv)
|
||||
import Control.Monad (foldM,liftM)
|
||||
import Data.List (nub)
|
||||
|
||||
-- AR 19/4/2000 -- 28/4/2005
|
||||
-- AR 19/4/2000 -- 21/3/2006
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
@@ -52,7 +52,8 @@ main = do
|
||||
putStrLnFlush $ encodeUTF8 helpMsg
|
||||
|
||||
_ | opt forJava -> do
|
||||
putStrLnFlush $ encodeUTF8 welcomeMsg
|
||||
welcome <- welcomeMsgLib
|
||||
putStrLnFlush $ encodeUTF8 welcome
|
||||
st <- useIOE st0 $
|
||||
foldM (shellStateFromFiles os) st0 fs
|
||||
sessionLineJ True st
|
||||
@@ -77,8 +78,8 @@ main = do
|
||||
if opt beSilent then return () else putStrLnFlush "</gfbatch>"
|
||||
return ()
|
||||
_ -> do
|
||||
|
||||
ifNotSil $ putStrLnFlush $ welcomeMsg
|
||||
welcome <- welcomeMsgLib
|
||||
ifNotSil $ putStrLnFlush $ welcome
|
||||
st <- useIOE st0 $
|
||||
foldM (shellStateFromFiles os) st0 fs
|
||||
if null fs then return () else (ifNotSil putCPU)
|
||||
@@ -110,9 +111,16 @@ helpMsg = unlines [
|
||||
"which suppresses all messages except the output and fatal errors."
|
||||
]
|
||||
|
||||
welcomeMsg =
|
||||
welcomeMsgLib = do
|
||||
lib <- catch
|
||||
(getEnv "GF_LIB_PATH" >>= return . ("GF_LIB_PATH is set to" +++))
|
||||
(const (return "Warning: GF_LIB_PATH is not defined."))
|
||||
return $ welcomeMsg lib
|
||||
|
||||
welcomeMsg lib =
|
||||
"Welcome to " ++ authorMsg ++++
|
||||
"If ä and ö (umlaut letters) look strange, see 'h -coding'." ++
|
||||
"\n" ++ lib ++
|
||||
"\n\nType 'h' for help, and 'h [Command] for more detailed help.\n"
|
||||
|
||||
authorMsg = unlines [
|
||||
|
||||
@@ -24,6 +24,7 @@ import qualified GF.Grammar.Lookup as L
|
||||
import qualified GF.Canon.GFC as GFC
|
||||
import qualified GF.Canon.Look as Look
|
||||
import qualified GF.Canon.CMacros as CMacros
|
||||
import qualified GF.Grammar.MMacros as MMacros
|
||||
import qualified GF.Compile.GrammarToCanon as GrammarToCanon
|
||||
import GF.Grammar.Values
|
||||
import GF.UseGrammar.GetTree
|
||||
@@ -236,7 +237,10 @@ execC co@(comm, opts0) sa@(sh@(st,(h,_,_,_)),a) = checkOptions st co >> case com
|
||||
let ss = (if oElem showAll opts then id else filter (not . null)) $
|
||||
lines $ prCommandArg a
|
||||
mts <- mapM parse ss
|
||||
let a' = ATrms [t | (_,ATrms ts) <- mts, t <- ts]
|
||||
let mark s ts = case ts of
|
||||
[] -> [MMacros.uTree] -- to leave a trace of unparsed line
|
||||
_ -> ts
|
||||
let a' = ATrms [t | (s,(_,ATrms ts)) <- zip ss mts, t <- mark s ts]
|
||||
changeArg (const a') sa
|
||||
| otherwise -> parse $ prCommandArg a
|
||||
where
|
||||
|
||||
@@ -60,7 +60,7 @@ formatAsCodeLit :: String -> String
|
||||
formatAsCodeLit = formatAsCode . unwords . map unStringLit . words
|
||||
|
||||
formatAsText,formatAsHTML,formatAsLatex :: String -> String
|
||||
formatAsText = formatAsTextGen (=="&-") (=="&-")
|
||||
formatAsText = formatAsTextGen (const False) (=="&-")
|
||||
formatAsHTML = formatAsTextGen (\s -> take 1 s == "<" || last s == '>') (const False)
|
||||
formatAsLatex = formatAsTextGen ((=="\\") . take 1) (const False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user