redpen-cc / redpen

RedPen is an open source proofreading tool to check if your technical documents meet the writing standard. RedPen supports various markup text formats (Markdown, Textile, AsciiDoc, Re:VIEW, reStructuredText and LaTeX).

Home Page:https://redpen.cc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validating JSON data

stefanionescu opened this issue · comments

Hi! I'm a newbie here on RedPen and I can't access any documentation on your website.

I just wanted to know if I can validate text using a custom xml which is exported from your website.

Right now I'm using a web address to validate but I want to switch to xml. I use this in a Java app.

@stefanionescu Hi.
You can use custom XML which is exported from http://redpen.herokuapp.com/ . (or modifying conf/redpen-conf-en.xml in the package)

Hmm ok. I use a "validate" method to process text while using a web address. Do I use the same "validate" method when I work with XML or is there another one?

Hi @stefanionescu,

Thank you very much for trying RedPen.

You can use the customized XML configuration file for the RedPen server, since validate method supports to accept a XML file as config parameter.

screen shot 2017-06-13 at 9 53 38

You can see the detail usage in http://redpen.cc/docs/latest/index.html#server . Specifically you can try the validation with the custom XML file with local redpen server (localhost:8080) as follows.

$ curl --data document="Twas brillig and the slithy toves did gyre and gimble in the wabe" \
     --data lang=en --data format=PLAIN2 \
     --data config="`cat ./redpen-server/target/classes/conf/redpen-conf.xml`" \
     localhost:8080/rest/document/validate/
Line: 1, Offset: 0
    Sentence: Twas brillig and the slithy toves did gyre and gimble in the wabe
        Spelling: Found possibly misspelled word "brillig".
        Spelling: Found possibly misspelled word "slithy".
        Spelling: Found possibly misspelled word "toves".
        Spelling: Found possibly misspelled word "gyre".
        Spelling: Found possibly misspelled word "gimble".
        Spelling: Found possibly misspelled word "wabe".
        DoubledWord: Found repeated word "and".

Hi @stefanionescu I close this issue. Please let us know when you still have the problem reopening this issue.