Word macro to check grammar from XML rule set

Completed Posted Apr 2, 2008 Paid on delivery
Completed Paid on delivery

I have a project on sourceforge ([url removed, login to view]) that is a grammar checker. It is a simple executable that reads a set English grammar rules (Perl regular expressions) from an XML file and can use these to process a plain text document to see if any of the rules are broken and to suggest changes.

I would like to be able to run these rules on a Word document from within Word. It would be a difficult task to integrate with Word's built-in spelling and grammar checker, but I'm happy to run this as a separate macro/VBA project.

## Deliverables

The book "Word Hacks" published by O'Reilly (ISBN: 0-596-00493-1) includes Hack #82 which explains how to use perl regular expressions from Word. Preference will be given to coders with access to this book, so please mention it in your bid.

I need two macros. The first should parse the XML rule file and run through the tests it contains (perl regular expressions transforming example sentences, and the expected results). The second macro should start from the insertion point in the document, searching forward to the next bit of text that fails one of the rules, and display a message box to the user to say which rule has failed.

Here is an example rule:

<rule match="\bnot ((a)n( ))?(un(([^aeiou][a-z]{2})[a-z]*([ai]ble|ed|ing)))\b" suggestion="$2$3$5">

<except if="$4" matches="unrest"/>

<except if="$6" matches="der"/>

<description>Double negative.</description>

<test in="a not undeserving recipient" out="a deserving recipient"/>

<test in="it is not underdeveloped" out="it is not underdeveloped"/>

<test in="she is not an uncultured person" out="she is a cultured person"/>

<test in="it was not an unprovoked attack" out="it was a provoked attack"/>

</rule>

Perl PHP XML

Project ID: #3839801

About the project

1 proposal Remote project Active Apr 16, 2008

Awarded to:

sambenton

See private message.

$136 USD in 14 days
(1 Review)
2.3