WEBVTT 00:00:00.150 --> 00:00:04.850 Hi. This is an introduction to the language tool rule editor. 00:00:05.440 --> 00:00:08.913 LanguageTool is an open source style and grammar checker. 00:00:09.194 --> 00:00:13.892 It finds errors by searching a text for error patterns. 00:00:14.725 --> 00:00:18.049 This rule editor lets you write those error patterns. 00:00:18.798 --> 00:00:22.451 In other words, if you know how to use this rule editor, 00:00:22.521 --> 00:00:24.911 you can help make the LanguageTool more powerful. 00:00:29.413 --> 00:00:31.271 I'll now show you how to use it. 00:00:32.452 --> 00:00:35.387 First, make sure the correct language is set. 00:00:36.063 --> 00:00:40.462 Now, you need to think of a specific error that you want LanguageTool to detect 00:00:41.765 --> 00:00:45.944 Think of a sentence with this error and enter it to the wrong sentence field. 00:00:48.490 --> 00:00:50.374 For this example, I'll use the error: 00:00:50.477 --> 00:00:52.137 "Sorry for my bed [sic] English" 00:00:52.140 --> 00:00:54.438 where "bad" is misspelt (as "bed") 00:00:55.782 --> 00:00:58.181 I will also enter the correct version of this sentence 00:00:58.583 --> 00:01:00.308 into the corrected sentence field 00:01:01.489 --> 00:01:02.850 Click on the button. 00:01:03.400 --> 00:01:06.993 A new section opens where we can specify the error pattern. 00:01:07.513 --> 00:01:09.682 But first, the rule editor lets you know 00:01:09.682 --> 00:01:13.160 that LanguageTool already finds the error in our example sentence. 00:01:14.354 --> 00:01:18.183 As this is just an example, I will ignore this message. 00:01:20.522 --> 00:01:23.448 Now comes the main part – the error pattern. 00:01:25.620 --> 00:01:29.840 You can see in initial error patterns just one word: "bed". 00:01:30.569 --> 00:01:33.399 But "bed" itself is a correct word. 00:01:34.518 --> 00:01:36.329 If our pattern only contained this word, 00:01:37.303 --> 00:01:40.430 LanguageTool would complain about any sentence with the word "bed". 00:01:41.375 --> 00:01:43.153 That's obviously not useful at all. 00:01:44.313 --> 00:01:48.742 What I want is to say that "bed" is only wrong in specific contexts. 00:01:50.395 --> 00:01:53.839 In this case, it is only wrong followed by the word "English", 00:01:54.474 --> 00:01:57.073 so i click the "add token to pattern" link 00:01:58.334 --> 00:02:00.821 and here I add the word "English". 00:02:02.979 --> 00:02:04.722 This pattern will now match all sentences 00:02:04.722 --> 00:02:09.780 where the word "bed" with an "e" is directly followed by the word "English". 00:02:12.138 --> 00:02:13.847 I will try out the rule now. 00:02:14.510 --> 00:02:16.320 For that, I give the rule a name. 00:02:18.250 --> 00:02:23.162 This name is what a user of LanguageTool will see in the configuration dialogue, 00:02:24.220 --> 00:02:25.562 and I'll add a message. 00:02:26.878 --> 00:02:30.720 This is what the LanguageTool user will see if the rule matches a sentence. 00:02:31.691 --> 00:02:33.942 So it should be a short helpful text. 00:02:35.153 --> 00:02:38.750 I'll put single quotes ('') around the correct word to mark it as a suggestion. 00:02:39.829 --> 00:02:44.234 The other fields are optional and we'll leave them just blank for now. 00:02:45.152 --> 00:02:47.931 Now when clicking the "evaluate error pattern button" 00:02:48.489 --> 00:02:50.282 both my example sentences get checked 00:02:51.262 --> 00:02:57.124 plus a few thousand other test sentences, for example from Wikipedia. 00:02:59.523 --> 00:03:01.433 Everything is ok so far 00:03:01.710 --> 00:03:05.379 and the rule editor displays the snippet of XML code. 00:03:06.736 --> 00:03:10.112 This is the code that LanguageTool needs to use your rule. 00:03:11.515 --> 00:03:15.427 If you think your rule is useful for future versions of LanguageTool, 00:03:15.840 --> 00:03:17.028 please send it to the developers. 00:03:18.083 --> 00:03:20.516 There's a link here with contact information. 00:03:22.791 --> 00:03:26.359 Now let's have a look at what happens if your rule doesn't quite work. 00:03:27.871 --> 00:03:31.178 Assume for example your rule was only one word: 00:03:31.920 --> 00:03:33.113 "Bed" with an "e". 00:03:34.240 --> 00:03:37.551 If I evaluate this rule, I get a lot of matches, 00:03:37.691 --> 00:03:39.985 and these matches don't seem to have errors. 00:03:41.000 --> 00:03:44.310 This is a clear sign that the pattern is not strict enough 00:03:44.739 --> 00:03:46.868 so one might want to add another word. 00:03:48.554 --> 00:03:51.967 So for now, we've only looked at matching simple words. 00:03:52.907 --> 00:03:57.453 But you can also match regular expressions by clicking the "Regex" check box. 00:03:59.000 --> 00:04:03.609 For example, match English or French by using a pipe [ | ] symbol. 00:04:05.222 --> 00:04:08.033 You can also match words by their part of speech. 00:04:09.989 --> 00:04:12.782 Click the "part of speech" radio button and enter the text field. 00:04:14.318 --> 00:04:19.789 For some languages, a help will show up about the parts of speech that can be addressed. 00:04:21.487 --> 00:04:23.399 This help will tell you for example that 00:04:23.399 --> 00:04:27.991 "NNP" is the code for singular proper nouns in English. 00:04:32.893 --> 00:04:34.327 If you evaluate the rule with this, 00:04:35.351 --> 00:04:39.164 it will also work as the word "English" is detected as a singular proper noun. 00:04:40.810 --> 00:04:44.534 If you use a part of speech that doesn't match, the rule editor will let you know. 00:04:45.311 --> 00:04:49.420 Like this, you can see the part of speech of the example sentence here. 00:04:51.984 --> 00:04:54.703 So this was our short introduction to the rule editor. 00:04:55.524 --> 00:04:59.544 We hope you use it to create new error patterns to make LanguageTool more powerful. 00:05:00.840 --> 00:05:04.295 If you have questions, feel free to contact us on the forum. 00:05:04.564 --> 00:05:07.250 You can find the link on LanguageTool.org (https://languagetool.org/) 00:05:07.280 --> 00:05:09.000 This video was subtitled by safetex@ymail.com