Link Grammar .Net

15 views
Skip to first unread message

proai

unread,
May 19, 2009, 10:45:14 PM5/19/09
to link-grammar
I ported Link Grammar (4.1) to .NET I was attempting to convert the
new Linux friendly version and so far I can't even get them (any of
the versions) to compile. I have tried all the sugestions in this
group to no avail. I have made some progress but still won't
compile. I have already spent more time trying to get it to compile
that it took me to port the old version to .NET. Has anyone tried to
get this working in .NET? I am concerned that even if I do get it to
compile it still won't work for what I need it to do.

I was wondering how compatible the new dictionaries are to the 4.1
dictionaries? I like the fact that the api is now being maintained
but it seems that it is going in a different direction. I am a little
fustrated and trying to see if there is anything here I can use or if
I need to start over and port the entire lib to .NET (I'll make it run
in mono).

Linas Vepstas

unread,
May 19, 2009, 11:20:21 PM5/19/09
to link-g...@googlegroups.com
2009/5/19 proai <lch...@proai.com>:

>
> I have made some progress but still won't
compile.

No one can help you if you don't indicate what the
problem is.

> I was wondering how compatible the new dictionaries are to the 4.1
> dictionaries?

The new dictionaries will not work with the old parser,
because the new dictionaries contain UTF8 characters.
The old dictionaries should work with the new parser.

> I like the fact that the api is now being maintained
> but it seems that it is going in a different direction.

The API has not changed at all, except to vastly simplify
dictionary loading, which used to be very buggy and
unreliable.

> I am a little
> fustrated and trying to see if there is anything here I can use or if
> I need to start over and port the entire lib to .NET (I'll make it run
> in mono).

The API has not changed at all, except to add some new routines to
simplify dictionary lading.

--linas

proai

unread,
May 20, 2009, 2:49:21 AM5/20/09
to link-grammar
Just to see what the differences are I wrote a quick BNF parser using
Irony for the dictionary and wow, they are very different. the UTF8
Chars made my parser very unhappy. The old dictionary (4.1) parses no
problem the new one makes defining a valid identifer a bit tricky but
since you guys are making a word processor I can see why you took that
route.


the errors I am getting using MingW32 are:

api.c: In function `post_process_linkages':
api.c:872: error: implicit declaration of function `rand_r'
api.c:872: warning: nested extern declaration of `rand_r'
api.c: In function `sentence_create':
api.c:996: error: implicit declaration of function `bzero'
api.c:996: warning: nested extern declaration of `bzero'
make[2]: *** [api.lo] Error 1
make[2]: Leaving directory `/f/apps/ai/linkgrammar-01-22-07/link-
grammar-4.5.5/link-grammar'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/f/apps/ai/linkgrammar-01-22-07/link-
grammar-4.5.5/link-grammar'
make: *** [all-recursive] Error 1


If anyone is interested, here is the code for an irony LinkGrammar
Grammar (needs some work to read a 4.5.5 dictionary though:

var singleLineComment = new CommentTerminal
("SingleLineComment", "%", "\r", "\n", "\u2085", "\u2028", "\u2029");
NonGrammarTerminals.Add(singleLineComment);
var identifier = new IdentifierTerminal("identifier", "+-
*._,", "‘0123456789-@/’'$");
var literal = new StringLiteral("qouted","\"");
var ruleExpr = new NonTerminal("ruleExpr");
var expr = new NonTerminal("exression", typeof
(StatementListNode));
var binaryExpression = new NonTerminal("binaryExpression",
typeof(BinExprNode));
var binaryOperator = new NonTerminal("binaryOperator");
var identifierList = new NonTerminal("identifierList");
var expressionList = new NonTerminal("expressionList");
var term = new NonTerminal("term");
term.Rule = identifier | "<" + identifier + ">" | literal;
identifierList.Rule = term | term + identifierList;
expr.Rule = identifierList + ":" + ruleExpr + ";";
binaryOperator.Rule = Symbol("&") | "or";
ruleExpr.Rule = term | binaryExpression | "(" + ruleExpr +
")" | "{" + ruleExpr + "}" | "[" + ruleExpr + "]" | "()";
binaryExpression.Rule = ruleExpr + binaryOperator +
ruleExpr;
expressionList.Rule = expr | expr + expressionList;
Root = expressionList;
RegisterOperators(1, "&", "or");
RegisterPunctuation("(", ")");
RegisterPunctuation("[", "]");
RegisterPunctuation("{", "}");
RegisterPunctuation(";");
RegisterPunctuation(NewLine);
Delimiters = "{}[]();:";

Linas Vepstas

unread,
May 20, 2009, 12:41:27 PM5/20/09
to link-g...@googlegroups.com
2009/5/20 proai <lch...@proai.com>:

>
> the errors I am getting using MingW32 are:

These were reported only a few days ago by evgenii,
and I think these are now fixed in the latest svn.

try getting the latest svn, then grabbing utilities.h
from that, and copying it into your build directory.

I think that should fix things.

--linas

Meidan

unread,
May 21, 2009, 9:30:25 AM5/21/09
to link-grammar
Hi Proai,

I'm not sure I understand correctly, do you have a working .NET port
of Link Grammar 4.1?
If so, could you post it please?
Thanks.

Leonard H. Chalk

unread,
May 21, 2009, 11:09:12 AM5/21/09
to link-g...@googlegroups.com
Yes I do, it is available at http://proai.com/cs/files/7/default.aspx

Leonard H. Chalk

unread,
May 21, 2009, 11:09:12 AM5/21/09
to link-g...@googlegroups.com
Yes I do, it is available at http://proai.com/cs/files/7/default.aspx



-----Original Message-----
From: link-g...@googlegroups.com [mailto:link-g...@googlegroups.com] On Behalf Of Meidan
Sent: Thursday, May 21, 2009 9:30 AM
To: link-grammar
Subject: [Link Grammar] Re: Link Grammar .Net


Leonard H. Chalk

unread,
May 21, 2009, 11:09:12 AM5/21/09
to link-g...@googlegroups.com
Yes I do, it is available at http://proai.com/cs/files/7/default.aspx



-----Original Message-----
From: link-g...@googlegroups.com [mailto:link-g...@googlegroups.com] On Behalf Of Meidan
Sent: Thursday, May 21, 2009 9:30 AM
To: link-grammar
Subject: [Link Grammar] Re: Link Grammar .Net


Leonard H. Chalk

unread,
May 21, 2009, 11:09:12 AM5/21/09
to link-g...@googlegroups.com
Yes I do, it is available at http://proai.com/cs/files/7/default.aspx



-----Original Message-----
From: link-g...@googlegroups.com [mailto:link-g...@googlegroups.com] On Behalf Of Meidan
Sent: Thursday, May 21, 2009 9:30 AM
To: link-grammar
Subject: [Link Grammar] Re: Link Grammar .Net


Linas Vepstas

unread,
May 21, 2009, 12:23:52 PM5/21/09
to link-g...@googlegroups.com
2009/5/21 Leonard H. Chalk <lch...@proai.com>:

>
> Yes I do, it is available at http://proai.com/cs/files/7/default.aspx
>

> I'm not sure I understand correctly, do you have a working .NET port
> of Link Grammar 4.1?

port, or bindings? I assume you mean "bindings" not "port".

--linas

Leonard H. Chalk

unread,
May 21, 2009, 11:09:12 AM5/21/09
to link-g...@googlegroups.com
Yes I do, it is available at http://proai.com/cs/files/7/default.aspx



-----Original Message-----
From: link-g...@googlegroups.com [mailto:link-g...@googlegroups.com] On Behalf Of Meidan
Sent: Thursday, May 21, 2009 9:30 AM
To: link-grammar
Subject: [Link Grammar] Re: Link Grammar .Net


Leonard H. Chalk

unread,
May 21, 2009, 11:09:12 AM5/21/09
to link-g...@googlegroups.com
Yes I do, it is available at http://proai.com/cs/files/7/default.aspx



-----Original Message-----
From: link-g...@googlegroups.com [mailto:link-g...@googlegroups.com] On Behalf Of Meidan
Sent: Thursday, May 21, 2009 9:30 AM
To: link-grammar
Subject: [Link Grammar] Re: Link Grammar .Net


Leonard H. Chalk

unread,
May 21, 2009, 11:09:12 AM5/21/09
to link-g...@googlegroups.com
Yes I do, it is available at http://proai.com/cs/files/7/default.aspx



-----Original Message-----
From: link-g...@googlegroups.com [mailto:link-g...@googlegroups.com] On Behalf Of Meidan
Sent: Thursday, May 21, 2009 9:30 AM
To: link-grammar
Subject: [Link Grammar] Re: Link Grammar .Net


Reply all
Reply to author
Forward
0 new messages