@ faircopy/ rules- nlp
可选的 NLP 动力规则集 compromise。 。 。 .
npm i -D @faircopy/rules-nlp
装入规则片一次, 然后配置规则 赤裸的规则ID :
rulesets: ['@faircopy/rules-nlp'],
rules: {
'no-absolute-intensifiers': 'warn',
'no-adverb-overuse': 'warn',
'no-expletive-openers': 'warn',
'no-filter-words': 'warn',
'no-future-promises': 'warn',
'no-hedge-words': 'warn',
'no-empty-transformation-claims': 'warn',
'no-passive-voice': 'warn',
'no-qualifier-creep': 'warn',
'no-redundant-pairs': 'warn',
'no-vague-comparatives': 'warn',
'no-weak-modals': 'warn',
'no-stacked-adjectives': 'warn',
'no-nominalized-phrases': 'warn',
'no-noun-strings': 'warn',
'no-pronoun-led-claims': 'warn',
'no-buzzword-stacks': 'warn',
'no-complex-readability': 'warn',
'no-overly-complex-sentences': 'warn',
'no-vague-quantifiers': 'warn',
'no-meaningless-modifiers': 'warn',
'no-superlative-claims': 'warn',
'no-llm-speak': 'warn',
'no-n-things': 'warn',
'no-weak-verbs': 'warn',
}
软件包合格标识 @faircopy/rules-nlp/no-passive-voice 仍然工作,如果另一个装入的规则显示相同的赤裸规则名称,则需要使用.
规则
| 规则 | 说明 |
|---|---|
no-absolute-intensifiers | 绝对形容词前的旗帜加速度 very unique |
no-adverb-overuse | 带有两个以上副词的旗帜句子以 -ly |
no-empty-transformation-claims | 旗子宽变的陈词滥调 transform the way teams work |
no-expletive-openers | 旗下句子打开像 There are |
no-filter-words | 禁用过滤短语 I think 财务报告和审定财务报表 it seems |
no-future-promises | 旗下未来的美好承诺 will help you |
no-hedge-words | 旗杆词类 kind of 财务报告和审定财务报表 somewhat |
no-jargon | 旗下商业术语 leverage 财务报告和审定财务报表 circle back |
no-passive-voice | 标记可能的被动语音构造 |
no-qualifier-creep | 旗上堆放的限定词或加速度等 very really good |
no-redundant-pairs | 旗下冗余的固定词组 first and foremost |
no-vague-comparatives | 标出省略明确基线的比较索赔 |
no-weak-modals | 国旗套期模式债权 can help 财务报告和审定财务报表 might improve |
no-stacked-adjectives | 在名词前加多个形容词的旗帜名词短语 |
no-nominalized-phrases | 标记 X of Y 短语类 optimization of onboarding |
no-noun-strings | 连续名词的旗下密集字符串 user experience design process |
no-pronoun-led-claims | 旗帜模糊的句子打开者喜欢 This helps 财务报告和审定财务报表 It enables |
no-buzzword-stacks | 带有抽象益惠名词的旗下句子超载 |
no-complex-readability | Flesch-Kincaid 级别超过目标的旗手 |
no-overly-complex-sentences | 旗下句子加载协调或次协调组合 |
no-vague-quantifiers | 无数字锚标的旗下光刻符 |
no-meaningless-modifiers | 旗下加速度像 very 财务报告和审定财务报表 obviously 没有添加信息 |
no-superlative-claims | 旗下未证实的叠加 best 财务报告和审定财务报表 world-class |
no-non-inclusive-language-nlp | 标出非包容性术语并提出中性替代办法 |
no-llm-speak | 旗下LLM的陈词滥调 delve into 财务报告和审定财务报表 robust 并提出具体的备选办法 |
no-n-things | 标记所计占位符框架, 如 Three things. 财务报告和审定财务报表 5 things to know |
no-weak-verbs | 旗帜模糊动作动词如 make 财务报告和审定财务报表 perform 并提出更强有力的备选方案 |
sentence-complexity | 超过文字或条款阈值的旗帜句子 |
no-absolute-intensifiers
绝对形容词已经表达出一种极端,因此强化词如 very 是多余的.
rules: {
'no-absolute-intensifiers': 'warn',
}
选项 :
| 选项 | 类型 | 默认 | 说明 |
|---|---|---|---|
intensifiers | string[] | ['very', 'really', 'completely', ...] | 可视为强化词或短语 |
absolutes | string[] | ['unique', 'finished', 'destroyed', ...] | 不应强化的绝对形容词 |
示例
'no-absolute-intensifiers': ['warn', {
intensifiers: ['very', 'highly'],
absolutes: ['unique', 'critical'],
}]
sentence-complexity
长,条款重的句子更难读取. 这个规则标出任何句子超过可配置的单词计数或包含太多有限制的动词条款,并建议将其分作更短的句子.
rules: {
'sentence-complexity': 'warn',
}
选项 :
| 选项 | 类型 | 默认 | 说明 |
|---|---|---|---|
maxWordCount | number | 25 | 每句允许的最大字数 |
maxClauseCount | number | 3 | 每句允许的最大限定动词条款 |
带有自定义阈值的示例 :
'sentence-complexity': ['warn', {
maxWordCount: 20,
maxClauseCount: 2,
}]
标记示例 :
The engineer reviewed the requirements and wrote the code and ran the tests and deployed the application while the team watched and celebrated the release together.
建议的修补:将每一独立条款的句子分开.
The engineer reviewed the requirements. They wrote the code, ran the tests, and deployed the application. The team watched and celebrated the release together.
no-overly-complex-sentences
装有联想的句子常常会跑来跑去,或者筑得太深. 此规则标出任何句子超过可配置的坐标相接数,次相接数,或总相接数.
rules: {
'no-overly-complex-sentences': 'warn',
}
选项 :
| 选项 | 类型 | 默认 | 说明 |
|---|---|---|---|
maxConjunctions | number | 4 | 每句允许的最大总数 |
maxCoordinating | number | 3 | 每句允许的最大坐标组合 |
maxSubordinating | number | 2 | 每句允许的最大次坐标组合 |
coordinating | string[] | ['and', 'but', 'or', 'nor', 'yet', 'so'] | 作为协调组合的单词 |
subordinating | string[] | ['because', 'although', 'though', 'while', 'since', 'unless', 'if', 'when', 'after', 'before', 'until', 'whether', 'once'] | 单词作为次排序组合 |
allowList | string[] | [] | 计数时忽略的单词 |
带有自定义阈值的示例 :
'no-overly-complex-sentences': ['warn', {
maxConjunctions: 3,
maxCoordinating: 2,
maxSubordinating: 1,
}]
标记示例 :
I ran and swam and biked and hiked and climbed.
建议的修补:将清单分为更短的句子,或使用一个圆形清单.
I ran, swam, and biked. Then I hiked and climbed.
一些词,例如: since 或者说 so,可以在特定情况下作为前置或副词. 如果规则太吵 无法复制, 加字到 allowList。 。 。 .
no-vague-comparatives
比较索赔 faster, (中文(简体) ), easier,或 more efficient 只有在读者知道基线时才能说服. 此规则标记了非配对的比较形容词和副词 than 在同一句话中.
rules: {
'no-vague-comparatives': 'warn',
}
选项 :
| 选项 | 类型 | 默认 | 说明 |
|---|---|---|---|
comparatives | string[] | ['better', 'worse', 'more', 'less', 'faster', 'slower', 'easier', 'harder', 'stronger', 'weaker', 'higher', 'lower', 'bigger', 'smaller', 'greater'] | 需要基准的比较词或短语 |
requireThan | boolean | true | 是否为 a than 在同一句中 |
带有自定义设置的示例 :
'no-vague-comparatives': ['warn', {
comparatives: ['superior', 'inferior', 'better'],
requireThan: true,
}]
标记示例 :
Our editor is faster. It is also easier to use.
建议的固定:增加一个具体基准.
Our editor is faster than the old one. It is also easier to use than a spreadsheet.
no-qualifier-creep
堆积的限定词或强化词稀释了债权,使其发出被套入的声音. 本规则在形容词或副词前由两个或两个以上的修饰词组所构成.
rules: {
'no-qualifier-creep': 'warn',
}
选项 :
| 选项 | 类型 | 默认 | 说明 |
|---|---|---|---|
qualifiers | string[] | ['very', 'really', 'quite', ...] | 作为限定词或强化词的单词 |
maxQualifiers | number | 1 | 在超过部分标出前行中允许的最大限定符 |
带有自定义设置的示例 :
'no-qualifier-creep': ['warn', {
qualifiers: ['very', 'really', 'quite'],
maxQualifiers: 1,
}]
标记示例 :
The result is very really quite good.
建议固定:保留最强的限定词或用具体证据来取代该短语.
The result is excellent.
no-non-inclusive-language-nlp
非包容性术语可以疏远读者. 这个规则标记了常见的非包容性语言,并且建议使用NLP-意识相匹配的中性替代品,这样它就能理解词边界和部分语境.
rules: {
'no-non-inclusive-language-nlp': 'warn',
}
选项 :
| 选项 | 类型 | 默认 | 说明 |
|---|---|---|---|
terms | NonInclusiveTerm[] | 见来源 | 标出名称的术语,每个名称都有备选名称清单 |
allowedTerms | string[] | [] | 允许和跳过的条件 |
带有自定义术语的示例:
'no-non-inclusive-language-nlp': ['warn', {
terms: [
{ term: 'guys', alternatives: ['everyone', 'team', 'folks'] },
{ term: 'blacklist', alternatives: ['denylist', 'blocklist'] },
],
allowedTerms: ['whitelist'],
}]
标记示例 :
Hey guys, add this to the blacklist and do a sanity check.
建议的固定:
Hey everyone, add this to the blocklist and do a quick check.
规则使用 compromise 以避免部分字词匹配(例如, guyses 而不标记),并跳过只使用动词的模糊词,例如 master 内 master the skill。 。 。 .
no-llm-speak
LLM生成的拷贝往往会回落到添加,抽象的短语中,这些短语听起来很权威,但并不多说. 这一规则标出LLM常见的陈词滥调并提出了混凝土取而代之的建议.
rules: {
'no-llm-speak': 'warn',
}
选项 :
| 选项 | 类型 | 默认 | 说明 |
|---|---|---|---|
phrases | LlmSpeakPhrase[] | 见来源 | 要标的词, 每个词都有替代词列表 |
allowedPhrases | string[] | [] | 允许和跳过的措辞 |
带有自定义短语的示例 :
'no-llm-speak': ['warn', {
phrases: [
{ phrase: 'delve into', alternatives: ['explore', 'examine'] },
{ phrase: 'robust', alternatives: ['strong', 'resilient'] },
],
allowedPhrases: ['crucial'],
}]
标记示例 :
It's important to note that we will delve into the robust, intricate tapestry. Furthermore, the system is crucial.
建议的固定:
Note that we will explore the strong, detailed pattern. Also, the system is critical.
规则使用 compromise 用于文字意识匹配,所以 robustness 当配置的词组是 robust。 。 。 .
no-weak-verbs
模糊动作动词如 make, (中文(简体) ), perform, (中文(简体) ), conduct,以及 carry out 隐藏真正的行动。 这个规则会标出用作动词的弱动词并提出了更强更具体的替代方案. 用这个 compromise 以识别动词表达,所以 made, (中文(简体) ), performed,以及 carried out 也标出标记,而名词用法如 the make of the car 被忽略.
rules: {
'no-weak-verbs': 'warn',
}
选项 :
| 选项 | 类型 | 默认 | 说明 |
|---|---|---|---|
verbs | WeakVerb[] | [{ verb: 'make', alternatives: ['create', 'build', 'produce'] }, ...] | 要标的动词,每个动词都有建议选项 |
allowList | string[] | [] | 允许和跳过的动词或短语 |
有自定义动词的例子 :
'no-weak-verbs': ['warn', {
verbs: [
{ verb: 'utilize', alternatives: ['use'] },
{ verb: 'leverage', alternatives: ['use', 'exploit'] },
],
allowList: ['make'],
}]
标记示例 :
We need to make a decision, perform a review, and carry out the plan.
建议的固定:
We need to decide, review, and implement the plan.
由于规则通过动词活字来匹配,它也可能标出常见的用词动词和平话等 make out, (中文(简体) ), make do,或 made it添加到 allowList 如果你的风格指南能接受的话.
no-noun-strings
连续三个或三个以上的名词会生成密集,难以读取的化合物. 此规则将名词字符串相继标记,并建议用动词或预设来重写.
rules: {
'no-noun-strings': 'warn',
}
选项 :
| 选项 | 类型 | 默认 | 说明 |
|---|---|---|---|
maxConsecutiveNouns | number | 3 | 标记前允许的最大连续名词 |
allowedPhrases | string[] | [] | 允许和跳过的措辞 |
带有自定义设置的示例 :
'no-noun-strings': ['warn', {
maxConsecutiveNouns: 4,
allowedPhrases: ['user experience design process'],
}]
标记示例 :
The user experience design process is slow.
建议的固定:
The process for designing the user experience is slow.
规则使用 compromise 用于部分语音标记并跳过地名等适当的名词.
no-n-things
一个数加上一个占位名词 Three things., (中文(简体) ), 5 things to know before launch ——取出它的号码来作节奏而不是意义. 这个框架是一个有文献记载的AI-writing tell:选择计数是因为所列举的列表感到出拳,而不是因为内容要求很多项目. 标出标题中的项目,或放弃计数并陈述索赔.
rules: {
'no-n-things': 'warn',
}
选项 :
| 选项 | 类型 | 默认 | 说明 |
|---|---|---|---|
minCount | number | 2 | 标记前的最小基本数; 保留 one thing 独行 |
nouns | string[] | ['thing', 'things'] | 完成此程序的占位符名词 N ___ 边框 |
allowedPhrases | string[] | [] | 允许和跳过的措辞 |
带有自定义设置的示例 :
'no-n-things': ['warn', {
minCount: 3,
nouns: ['thing', 'things', 'tips', 'takeaways'],
}]
标记示例 :
Three things you should know about memory.
建议的固定:
How Ditto remembers your conversations.
规则使用 compromise 用于部分语音标记。 只有红外线能触发它 First things first, (中文(简体) ), All things considered,以及 a few things 和具体的名词一样 three tabs。 。 。 .