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