📄 creating_rulesets.html.svn-base
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="generic.css" />
<title>Creating rules</title>
</head>
<body>
<h1>Creating rules</h1>
<p>To create a new rule set, create an XML document using the XML Schema ‘ruleset.xsd’.</p>
<p>Rule sets consist of a title, an optional copyright notice, optional lists of excluded and inherited house styles, and a list of rules. Rules are of two kinds. In most cases, each rule specifies a report string (e.g. ‘Words to avoid’) and a regular expression matching a phrase or spelling discouraged by the rule, plus a suggested replacement string.</p>
<p>Alternatively, rules can contain dictionaries. If at least one dictionary is selected, all words not found in the dictionary are reported as matches.</p>
<p>Files that are stored in the ‘rulesets’ directory are available from the left-hand drop-down menu in the Spelling and Style dialog.</p>
<p>Here is a sample rule set file:</p>
<pre><?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ruleset.xsd">
<title>Repetition</title>
<rule>
<report>one word</report>
<regex>
<find>\b(\w+) \1\b</find>
<replace tentative="true">\1</replace>
</regex>
</rule>
<rule>
<report>two words</report>
<regex>
<find>\b(\w+ \w+) \1\b</find>
<replace tentative="true">\1</replace>
</regex>
</rule>
</ruleset>
</pre>
<p>Rule sets are typically based on a hierarchy of modules (e.g. the default style inherits Commonwealth, Ise, Gender, etc.).</p>
<p>Exclusions can be used to block specific modules (e.g. to combine the default module for Commonwealth spelling with -ize/-yse rather than -ise spelling).</p>
<p>If available, ‘Default dictionary and style’ is selected at start-up.</p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -