@@ -42,28 +42,31 @@ The latest released version is [`1.0.2`][latest].
42
42
43
43
This document defines a format for representing natural language as a [ concrete
44
44
syntax tree] [ syntax-tree ] .
45
- Development of nlcst started in May 2014, in the now deprecated [ textom] [ ]
46
- project for [ retext] [ ] , before [ unist] [ ] existed.
45
+ Development of nlcst started in May 2014,
46
+ in the now deprecated [ textom] [ ] project for [ retext] [ ] ,
47
+ before [ unist] [ ] existed.
47
48
This specification is written in a [ Web IDL] [ webidl ] -like grammar.
48
49
49
50
### Where this specification fits
50
51
51
- nlcst extends [ unist] [ ] , a format for syntax trees, to benefit from its
52
- [ ecosystem of utilities] [ utilities ] .
52
+ nlcst extends [ unist] [ ] ,
53
+ a format for syntax trees,
54
+ to benefit from its [ ecosystem of utilities] [ utilities ] .
53
55
54
56
nlcst relates to [ JavaScript] [ ] in that it has an [ ecosystem of
55
57
utilities] [ list-of-utilities ] for working with compliant syntax trees in
56
58
JavaScript.
57
- However, nlcst is not limited to JavaScript and can be used in other programming
59
+ However,
60
+ nlcst is not limited to JavaScript and can be used in other programming
58
61
languages.
59
62
60
63
nlcst relates to the [ unified] [ ] and [ retext] [ ] projects in that nlcst syntax
61
64
trees are used throughout their ecosystems.
62
65
63
66
## Types
64
67
65
- If you are using TypeScript, you can use the nlcst types by installing them
66
- with npm:
68
+ If you are using TypeScript,
69
+ you can use the nlcst types by installing them with npm:
67
70
68
71
``` sh
69
72
npm install @types/nlcst
@@ -112,7 +115,8 @@ interface Paragraph <: Parent {
112
115
with a particular point or idea.
113
116
114
117
** Paragraph** can be used in a [ ** root** ] [ dfn-root ] node.
115
- It can contain [ ** sentence** ] [ dfn-sentence ] , [ ** whitespace** ] [ dfn-whitespace ] ,
118
+ It can contain [ ** sentence** ] [ dfn-sentence ] ,
119
+ [ ** whitespace** ] [ dfn-whitespace ] ,
116
120
and [ ** source** ] [ dfn-source ] nodes.
117
121
118
122
### ` Punctuation `
@@ -139,10 +143,11 @@ interface Root <: Parent {
139
143
140
144
** Root** ([ ** Parent** ] [ dfn-parent ] ) represents a document.
141
145
142
- ** Root** can be used as the [ * root* ] [ term-root ] of a [ * tree* ] [ term-tree ] , never
143
- as a [ * child* ] [ term-child ] .
144
- Its content model is not limited, it can contain any nlcst content, with the
145
- restriction that all content must be of the same category.
146
+ ** Root** can be used as the [ * root* ] [ term-root ] of a [ * tree* ] [ term-tree ] ,
147
+ never as a [ * child* ] [ term-child ] .
148
+ Its content model is not limited,
149
+ it can contain any nlcst content,
150
+ with the restriction that all content must be of the same category.
146
151
147
152
### ` Sentence `
148
153
@@ -154,13 +159,16 @@ interface Sentence <: Parent {
154
159
```
155
160
156
161
** Sentence** ([ ** Parent** ] [ dfn-parent ] ) represents grouping of grammatically
157
- linked words, that in principle tells a complete thought, although it may make
158
- little sense taken in isolation out of context.
162
+ linked words,
163
+ that in principle tells a complete thought,
164
+ although it may make little sense taken in isolation out of context.
159
165
160
166
** Sentence** can be used in a [ ** paragraph** ] [ dfn-paragraph ] node.
161
- It can contain [ ** word** ] [ dfn-word ] , [ ** symbol** ] [ dfn-symbol ] ,
162
- [ ** punctuation** ] [ dfn-punctuation ] , [ ** whitespace** ] [ dfn-whitespace ] , and
163
- [ ** source** ] [ dfn-source ] nodes.
167
+ It can contain [ ** word** ] [ dfn-word ] ,
168
+ [ ** symbol** ] [ dfn-symbol ] ,
169
+ [ ** punctuation** ] [ dfn-punctuation ] ,
170
+ [ ** whitespace** ] [ dfn-whitespace ] ,
171
+ and [ ** source** ] [ dfn-source ] nodes.
164
172
165
173
### ` Source `
166
174
@@ -171,10 +179,14 @@ interface Source <: Literal {
171
179
```
172
180
173
181
** Source** ([ ** Literal** ] [ dfn-literal ] ) represents an external (ungrammatical)
174
- value embedded into a grammatical unit: a hyperlink, code, and such.
182
+ value embedded into a grammatical unit: a hyperlink,
183
+ code,
184
+ and such.
175
185
176
- ** Source** can be used in [ ** root** ] [ dfn-root ] , [ ** paragraph** ] [ dfn-paragraph ] ,
177
- [ ** sentence** ] [ dfn-sentence ] , or [ ** word** ] [ dfn-word ] nodes.
186
+ ** Source** can be used in [ ** root** ] [ dfn-root ] ,
187
+ [ ** paragraph** ] [ dfn-paragraph ] ,
188
+ [ ** sentence** ] [ dfn-sentence ] ,
189
+ or [ ** word** ] [ dfn-word ] nodes.
178
190
179
191
### ` Symbol `
180
192
@@ -186,7 +198,8 @@ interface Symbol <: Literal {
186
198
187
199
** Symbol** ([ ** Literal** ] [ dfn-literal ] ) represents typographical devices
188
200
different from characters which represent sounds (like letters and numerals),
189
- white space, or punctuation.
201
+ white space,
202
+ or punctuation.
190
203
191
204
** Symbol** can be used in [ ** sentence** ] [ dfn-sentence ] or [ ** word** ] [ dfn-word ]
192
205
nodes.
@@ -213,10 +226,12 @@ interface WhiteSpace <: Literal {
213
226
```
214
227
215
228
** WhiteSpace** ([ ** Literal** ] [ dfn-literal ] ) represents typographical devices
216
- devoid of content, separating other units.
229
+ devoid of content,
230
+ separating other units.
217
231
218
232
** WhiteSpace** can be used in [ ** root** ] [ dfn-root ] ,
219
- [ ** paragraph** ] [ dfn-paragraph ] , or [ ** sentence** ] [ dfn-sentence ] nodes.
233
+ [ ** paragraph** ] [ dfn-paragraph ] ,
234
+ or [ ** sentence** ] [ dfn-sentence ] nodes.
220
235
221
236
### ` Word `
222
237
@@ -231,8 +246,10 @@ interface Word <: Parent {
231
246
uttered in isolation with semantic or pragmatic content.
232
247
233
248
** Word** can be used in a [ ** sentence** ] [ dfn-sentence ] node.
234
- It can contain [ ** text** ] [ dfn-text ] , [ ** symbol** ] [ dfn-symbol ] ,
235
- [ ** punctuation** ] [ dfn-punctuation ] , and [ ** source** ] [ dfn-source ] nodes.
249
+ It can contain [ ** text** ] [ dfn-text ] ,
250
+ [ ** symbol** ] [ dfn-symbol ] ,
251
+ [ ** punctuation** ] [ dfn-punctuation ] ,
252
+ and [ ** source** ] [ dfn-source ] nodes.
236
253
237
254
## Glossary
238
255
@@ -292,12 +309,17 @@ ways to get started.
292
309
See [ ` support.md ` ] [ support ] for ways to get help.
293
310
Ideas for new utilities and tools can be posted in [ ` syntax-tree/ideas ` ] [ ideas ] .
294
311
295
- A curated list of awesome syntax-tree, unist, mdast, hast, xast, and nlcst
296
- resources can be found in [ awesome syntax-tree] [ awesome ] .
312
+ A curated list of awesome syntax-tree,
313
+ unist,
314
+ mdast,
315
+ hast,
316
+ xast,
317
+ and nlcst resources can be found in [ awesome syntax-tree] [ awesome ] .
297
318
298
319
This project has a [ code of conduct] [ coc ] .
299
- By interacting with this repository, organization, or community you agree to
300
- abide by its terms.
320
+ By interacting with this repository,
321
+ organization,
322
+ or community you agree to abide by its terms.
301
323
302
324
## Acknowledgments
303
325
@@ -307,8 +329,8 @@ The initial release of this project was authored by
307
329
Thanks to
308
330
[ ** @nwtn ** ] ( https://github.com/nwtn ) ,
309
331
[ ** @tmcw ** ] ( https://github.com/tmcw ) ,
310
- [ ** @muraken720 ** ] ( https://github.com/muraken720 ) , and
311
- [ ** @dozoisch ** ] ( https://github.com/dozoisch )
332
+ [ ** @muraken720 ** ] ( https://github.com/muraken720 ) ,
333
+ and [ ** @dozoisch ** ] ( https://github.com/dozoisch )
312
334
for contributing to nlcst and related projects!
313
335
314
336
## License
0 commit comments