compromise
하는 일
compromise의 매치 문법, 선택, 플러그인을 사용해 영어 문장을 다루는 방법을 설명합니다. compromise 코드를 사용하거나 고치는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓compromise 라이브러리를 쓰면서 작업에 맞는 메서드가 필요할 때.
- ✓텍스트에서 단어나 구를 찾기 위해 매치 패턴을 작성할 때.
- ✓compromise 버전을 고르거나 플러그인을 추가해야 할 때.
스킬 링크
https://github.com/spencermountain/compromise/blob/master/skills/compromise/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 텍스트에서 날짜와 숫자를 모두 뽑아내려면 compromise의 어떤 메서드를 써야 하나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 설치된 버전과 빌드를 확인한 뒤, 맞는 메서드나 패턴을 고르고 결과에 무엇이 들어갈지 설명합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Using compromise
Compromise is a rule-based English NLP library that runs locally in Node.js and browsers. Its tagging and transformations are heuristic; it does not provide a dependency parse tree, semantic understanding, or an LLM service.
Choose the API for the installed version
Inspect the project's compromise version, import, and registered plugins before choosing APIs.
Prefer the full import nlp from 'compromise' for ordinary use:
| Import | Available features |
|---|---|
compromise or compromise/three |
Tokenization, tagging, named selections and transforms |
compromise/two |
Tokenization and tagging; no .people(), .verbs(), or .numbers() |
compromise/one or compromise/tokenize |
Tokenization; no automatic part-of-speech tagging |
Use the existing module system; CommonJS can use const nlp = require('compromise').
If a method is missing, check the build tier, version, and plugins before inventing a replacement API.
Specialized transforms belong on specialized selections: use .verbs().toPastTense(),
not .match('#Verb').toPastTense().
Read only the detailed docs needed for the task. These paths resolve inside this repository
and packages that ship this skill alongside docs/:
- API: method names, arguments, and specialized selection methods.
- Match syntax: pattern operators and capture groups.
- Tag definitions: valid tags and their hierarchy.
- Concepts: document, View, Term, and mutation semantics.
- Recipes: task-specific starting points.
- Tagging differences: conventions when comparing other taggers.
If this skill was installed separately, look for these files in the consuming project's
node_modules/compromise/docs/ or its resolved package directory. If unavailable, consult the
upstream repository at the installed version's
tag when available. Do not assume the latest docs describe an older installed version.
When docs and behavior disagree, reproduce against that version and inspect its source/types.
Keep the document and selection distinct
nlp(text) returns a View of the whole document. Selections return Views sharing that document.
Transforms mutate the shared document; reading .text() from a selection gives only that fragment.
Keep the whole-document variable when the requested output is the rewritten input:
import nlp from 'compromise'
const original = nlp('She walks home.')
const past = original.clone()
past.verbs().toPastTense()
past.text() // 'She walked home.'
original.text() // 'She walks home.'
Clone before transforming when the original must be preserved. Cloning a selection does not
turn it into a whole-document selection. .all() returns a View of the whole underlying document.
.match(pattern)extracts matching terms;.has(pattern)returns a boolean..if(pattern)filters the current phrases, retaining each whole phrase containing a match. Use.sentences().if(pattern)to retain matching sentences..foundis a boolean property, not a method. An empty View is still a truthy JavaScript object..replace(from, to)finds a pattern and replaces it;.replaceWith(to)replaces the selection..text()returns a string;.out('array')returns strings per match;.json()returns structured records. These are outputs, not chainable Views.- Text outputs can preserve case and punctuation.
.text('normal')is not a universal punctuation stripper. Choose and verify normalization for the requested output rather than stripping blindly.
Write term patterns, not character regexes
Patterns operate on tokenized terms within each sentence. Literal words match case-insensitively;
use {walk} to include inflections such as walked. Use real tag names: #Person, #Place,
#Organization, #Noun, #Verb, #Adjective, #Value, and #Date are useful starting points.
Tags form a hierarchy, so #FirstName also matches #Person and #Noun.
Unknown tags silently match nothing unless explicitly defined by an extension.
Do not invent tags such as #Name, #Location, #Subject, #Object, or #Adj.
| Pattern | Meaning |
|---|---|
#Adjective+ #Noun |
One or more adjective terms followed by a noun |
the big? cat |
Optional big term |
(cat|dog) |
Alternatives |
| `the . |
자주 묻는 질문
compromise의 어떤 버전이 필요한가요?
스킬은 메서드를 고르기 전에 프로젝트에 설치된 버전과 가져오기 방식을 확인하라고 설명합니다.
메서드가 없으면 어떻게 하나요?
다른 방법을 시도하기 전에 빌드 등급, 버전, 플러그인을 확인하라고 조언합니다.
의존성 파싱을 하나요?
아닙니다. compromise는 의존성 파스 트리나 의미 이해를 제공하지 않는다고 설명합니다.
상세 정보
작성자의 원본 설명
Write and debug JavaScript or TypeScript that uses the compromise English NLP library to match text, extract entities or numbers, customize tagging, and transform sentences. Use when the user requests compromise or the project already uses it, especially for its match syntax, selection semantics, build tiers, and plugins.
인기도
- GitHub 스타
- 12k
- 순위
- #11472
- 라이선스
- MIT
- 업데이트
- 2026. 10. 30.
댓글
- …