But what is offset then?

Ruud


On 27-12-12 22:26, Dominique Pellé wrote:
Ruud Baars <baar...@xs4all.nl <mailto:baar...@xs4all.nl>> wrote:

    Can anyone please explain what the added value is of the api
    values of:
    contextoffset and offset

    in:

    <error fromy="0" fromx="0" toy="0" tox="5"
       ruleId="UPPERCASE_SENTENCE_START"
       msg="This sentence does not start with an uppercase letter"
       replacements="This" context="this is a test."
       contextoffset="0" offset="0"
       errorlength="4" category="Capitalization"/>
    </matches>


    Ruud



Hi Ruud

* the contextoffset=... indicates the start position (in characters)
  of the error in the context="..." string  (0 being the beginning of
  of the context string)

* the errorlength=... indicates the length (number of
  Unicode characters) of the error

In other words, they indicate the substring that should
typically be highlighted in the context="..." string.
It corresponds to what is marked with <marker>...</marker>
in xml rules.

Taking your example:

context="this is a test."'
contextoffset="0"
errorlength="4"

It indicates that the error to highlight is the word "this"
(first 4 characters of the context string)

I use them at least in my LanguageTool plugin for the vim text editor
so please don't remove them :-)

http://www.vim.org/scripts/script.php?script_id=3223

Regards
-- Dominique



------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712


_______________________________________________
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel

Reply via email to