Re: CVS: commit dom abiword-plugins/tools/abigrammar/linkgrammarwrap LinkGrammarWrap.cpp

From: Dom Lachowicz <domlachowicz_at_yahoo.com>
Date: Tue Apr 04 2006 - 20:07:17 CEST

Should be backported.

--- cvs@abisource.com wrote:

>
> Update of
>
/cvsroot/abiword-plugins/tools/abigrammar/linkgrammarwrap
> In directory
>
abiword.snt.utwente.nl:/tmp/cvs-serv3577/linkgrammarwrap
>
> Modified Files:
> Tag: ABI-2-4-0-STABLE
> LinkGrammarWrap.cpp
> Log Message:
> use 2 new functions in link's public api. plugin
> builds again
>
> Index: LinkGrammarWrap.cpp
>
===================================================================
> RCS file:
>
/cvsroot/abiword-plugins/tools/abigrammar/linkgrammarwrap/LinkGrammarWrap.cpp,v
> retrieving revision 1.15.2.1
> retrieving revision 1.15.2.2
> diff -u -d -r1.15.2.1 -r1.15.2.2
> --- LinkGrammarWrap.cpp 24 Feb 2006 04:02:50 -0000
> 1.15.2.1
> +++ LinkGrammarWrap.cpp 4 Apr 2006 18:02:14 -0000
> 1.15.2.2
> @@ -66,7 +66,7 @@
> {
> if(!m_Dict)
> {
> - printf("No dictionary!! \n");
> + //printf("No dictionary!! \n");
> return true; // default to no grammar checking.
> }
> // printf("Sentence received |%s|
> \n",pT->sText.utf8_str());
> @@ -84,7 +84,7 @@
> bool res = (num_linkages >= 1);
> if(TRUE == parse_options_timer_expired(m_Opts))
> {
> - printf("!!! Timer expired! Mark valid anyway!
> ");
> + //printf("!!! Timer expired! Mark valid anyway!
> ");
> res= true; // Mark valid if it's too hard.
> FIXME. We can attempt to recover
> // by tweaking paramters once we
> know what we're doing.
> }
> @@ -112,14 +112,13 @@
> Linkage linkage = linkage_create(0, sent,
> m_Opts);
> if(linkage != NULL)
> {
> - Parse_info * pi = sent->parse_info;
> UT_sint32 i = 0;
> UT_sint32 iLow= 0;
> UT_sint32 iHigh= 0;
> UT_sint32 iOff = pT->iInLow;
> const char * szSent = pT->sText.utf8_str();
> UT_sint32 totlen = strlen(szSent);
> - for (i=1; i<sent->length && (iLow < totlen); i++)
> + for (i=1; i<sentence_length(sent) && (iLow <
> totlen); i++)
> {
> //
> // NULL link island.
> @@ -137,11 +136,11 @@
> }
> AbiGrammarError * pWordMap = new
> AbiGrammarError();
> pWordMap->m_iErrLow = iLow;
> - pWordMap->m_iErrHigh = iLow +
> strlen(sent->word[i].string);
> + pWordMap->m_iErrHigh = iLow +
> strlen(sentence_get_nth_word(sent, i));
> pWordMap->m_iWordNum = i;
> vecMapOfWords.addItem(pWordMap);
> bool bNew = false;
> - if(pi->chosen_disjuncts[i] == NULL)
> + if(!sentence_nth_word_has_disjunction(sent, i))
> {
> //printf("|%s| NULL LINK
> \n",sent->word[i].string);
> if(pErr == NULL)
> @@ -155,7 +154,7 @@
> {
> pErr = new AbiGrammarError();
> }
> - iHigh = iLow + strlen(sent->word[i].string);
> + iHigh = iLow +
> strlen(sentence_get_nth_word(sent, i));
> pErr->m_iErrLow = iLow + iOff -1;
> pErr->m_iErrHigh = iHigh + iOff -1;
> if(pErr->m_iErrLow < 0)
> @@ -175,7 +174,7 @@
> //
> // Expand the sqiggle
> //
> - iHigh = iLow + strlen(sent->word[i].string)
> + iOff;
> + iHigh = iLow +
> strlen(sentence_get_nth_word(sent, i)) + iOff;
> pErr->m_iErrHigh = iHigh;
> if(pErr->m_iErrHigh < totlen-1)
> {
> @@ -184,7 +183,7 @@
> pErr->m_iWordNum = i;
> }
> }
> - iLow += strlen(sent->word[i].string);
> + iLow += strlen(sentence_get_nth_word(sent, i));
> }
> //
> // No NULL links but still an error , mark the
> whole sentence bad.
>
> -----------------------------------------------
> To unsubscribe from this list, send a message to
> abisource-cvs-commit-request@abisource.com with the
> word
> unsubscribe in the message body.
>

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Received on Tue Apr 4 20:06:50 2006

This archive was generated by hypermail 2.1.8 : Tue Apr 04 2006 - 20:06:50 CEST