YouTube

Vous avez un compte YouTube ?

Nouveauté : activer les traductions et les sous-titres créés par les internautes sur votre chaîne YouTube !

English sous-titres

← LanguageTool Rule Editor Introduction

Obtenir le code d’intégration
1 langue

Afficher la révision 7 créée 07/25/2014 par Claude Almansi.

  1. Hi. This is an introduction to
    the language tool rule editor.

  2. LanguageTool is an open source
    style and grammar checker.
  3. It finds errors by searching a text
    for error patterns.
  4. This rule editor lets you
    write those error patterns.
  5. In other words, if you know
    how to use this rule editor,
  6. you can help make the LanguageTool
    more powerful.
  7. I'll now show you how to use it.
  8. First, make sure the correct language is set.
  9. Now, you need to think of a specific error
    that you want LanguageTool to detect
  10. Think of a sentence with this error
    and enter it to the wrong sentence field.
  11. For this example, I'll use the error:
  12. "Sorry for my bed [sic] English"
  13. where "bad" is misspelt (as "bed")
  14. I will also enter the correct version
    of this sentence
  15. into the corrected sentence field
  16. Click on the button.
  17. A new section opens where we can
    specify the error pattern.
  18. But first, the rule editor lets you know
  19. that LanguageTool already finds
    the error in our example sentence.
  20. As this is just an example,
    I will ignore this message.
  21. Now comes the main part – the error pattern.
  22. You can see in initial error patterns
    just one word: "bed".
  23. But "bed" itself is a correct word.
  24. If our pattern only contained this word,
  25. LanguageTool would complain about
    any sentence with the word "bed".
  26. That's obviously not useful at all.
  27. What I want is to say that "bed" is only
    wrong in specific contexts.
  28. In this case, it is only wrong
    followed by the word "English",
  29. so i click the "add token to pattern" link
  30. and here I add the word "English".
  31. This pattern will now match all sentences
  32. where the word "bed" with an "e"
    is directly followed by the word "English".
  33. I will try out the rule now.
  34. For that, I give the rule a name.
  35. This name is what a user of LanguageTool
    will see in the configuration dialogue,
  36. and I'll add a message.
  37. This is what the LanguageTool user will see
    if the rule matches a sentence.
  38. So it should be a short helpful text.
  39. I'll put single quotes ('') around the
    correct word to mark it as a suggestion.
  40. The other fields are optional and we'll
    leave them just blank for now.
  41. Now when clicking the
    "evaluate error pattern button"
  42. both my example sentences get checked
  43. plus a few thousand other test sentences,
    for example from Wikipedia.
  44. Everything is ok so far
  45. and the rule editor displays the snippet
    of XML code.
  46. This is the code that LanguageTool needs
    to use your rule.
  47. If you think your rule is useful for
    future versions of LanguageTool,
  48. please send it to the developers.
  49. There's a link here with contact information.
  50. Now let's have a look at what happens
    if your rule doesn't quite work.
  51. Assume for example your rule
    was only one word:
  52. "Bed" with an "e".
  53. If I evaluate this rule, I get
    a lot of matches,
  54. and these matches don't seem to have errors.
  55. This is a clear sign that the pattern
    is not strict enough
  56. so one might want to add another word.
  57. So for now, we've only looked at
    matching simple words.
  58. But you can also match regular expressions
    by clicking the "Regex" check box.
  59. For example, match English or French
    by using a pipe [ | ] symbol.
  60. You can also match words by
    their part of speech.
  61. Click the "part of speech" radio button
    and enter the text field.
  62. For some languages, a help will show up about
    the parts of speech that can be addressed.
  63. This help will tell you for example that
  64. "NNP" is the code for singular proper
    nouns in English.
  65. If you evaluate the rule with this,
  66. it will also work as the word "English"
    is detected as a singular proper noun.
  67. If you use a part of speech that doesn't
    match, the rule editor will let you know.
  68. Like this, you can see the part of speech
    of the example sentence here.
  69. So this was our short introduction
    to the rule editor.
  70. We hope you use it to create new error
    patterns to make LanguageTool more powerful.
  71. If you have questions, feel free
    to contact us on the forum.
  72. You can find the link on LanguageTool.org
    (https://languagetool.org/)
  73. This video was subtitled by safetex@ymail.com