@rsconcept/domain 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/analyzer-DlSq3Y3r.d.ts +39 -0
- package/dist/arguments-extractor-1acwjQNc.d.ts +38 -0
- package/dist/ast-C8sIpKdL.d.ts +51 -0
- package/dist/ast-annotations-BiMjkKvz.d.ts +16 -0
- package/dist/branded-ZlzIcxzu.d.ts +9 -0
- package/dist/calculator-C9W2jkSx.d.ts +39 -0
- package/dist/cctext/index.d.ts +2 -1
- package/dist/cctext/index.js +2 -42
- package/dist/cctext/language-api.d.ts +10 -12
- package/dist/cctext/language-api.js +157 -227
- package/dist/cctext/language-api.js.map +1 -1
- package/dist/cctext/language.d.ts +24 -22
- package/dist/cctext/language.js +43 -39
- package/dist/cctext/language.js.map +1 -1
- package/dist/error-E1LVq_3w.d.ts +87 -0
- package/dist/graph/graph.d.ts +2 -62
- package/dist/graph/graph.js +339 -382
- package/dist/graph/graph.js.map +1 -1
- package/dist/graph/index.d.ts +2 -1
- package/dist/graph/index.js +2 -384
- package/dist/graph-DR8rL2o3.d.ts +64 -0
- package/dist/hash-Y8I4c6Al.d.ts +8 -0
- package/dist/index-BKZ67WMa.d.ts +1 -0
- package/dist/index-BVVgDSdq.d.ts +1 -0
- package/dist/index-DmtQKWjk.d.ts +1 -0
- package/dist/index-_6s0AX1B.d.ts +1 -0
- package/dist/index.d.ts +27 -28
- package/dist/index.js +23 -5851
- package/dist/lezer-tree-iS7LpLBJ.d.ts +14 -0
- package/dist/library/folder-tree.d.ts +22 -20
- package/dist/library/folder-tree.js +108 -130
- package/dist/library/folder-tree.js.map +1 -1
- package/dist/library/index.d.ts +8 -17
- package/dist/library/index.js +7 -2800
- package/dist/library/library-api.d.ts +3 -1
- package/dist/library/library-api.js +9 -8
- package/dist/library/library-api.js.map +1 -1
- package/dist/library/library.d.ts +2 -56
- package/dist/library/library.js +23 -19
- package/dist/library/library.js.map +1 -1
- package/dist/library/oss-api.d.ts +26 -37
- package/dist/library/oss-api.js +258 -1096
- package/dist/library/oss-api.js.map +1 -1
- package/dist/library/oss-layout-api.d.ts +28 -28
- package/dist/library/oss-layout-api.js +239 -316
- package/dist/library/oss-layout-api.js.map +1 -1
- package/dist/library/oss-layout.d.ts +2 -25
- package/dist/library/oss-layout.js +1 -1
- package/dist/library/oss.d.ts +87 -89
- package/dist/library/oss.js +27 -26
- package/dist/library/oss.js.map +1 -1
- package/dist/library/rsengine.d.ts +100 -106
- package/dist/library/rsengine.js +439 -2599
- package/dist/library/rsengine.js.map +1 -1
- package/dist/library/rsform-api.d.ts +11 -16
- package/dist/library/rsform-api.js +313 -825
- package/dist/library/rsform-api.js.map +1 -1
- package/dist/library/rsform.d.ts +159 -167
- package/dist/library/rsform.js +29 -28
- package/dist/library/rsform.js.map +1 -1
- package/dist/library/rsmodel-api.d.ts +8 -15
- package/dist/library/rsmodel-api.js +172 -813
- package/dist/library/rsmodel-api.js.map +1 -1
- package/dist/library/rsmodel.d.ts +27 -33
- package/dist/library/rsmodel.js +16 -23
- package/dist/library/rsmodel.js.map +1 -1
- package/dist/library/structure-planner.d.ts +20 -26
- package/dist/library/structure-planner.js +106 -474
- package/dist/library/structure-planner.js.map +1 -1
- package/dist/library-CYun28Xz.d.ts +58 -0
- package/dist/oss-layout-3glgAqfn.d.ts +27 -0
- package/dist/parser-Bwd8LxJ1.d.ts +7 -0
- package/dist/parsing/ast.d.ts +2 -49
- package/dist/parsing/ast.js +68 -76
- package/dist/parsing/ast.js.map +1 -1
- package/dist/parsing/index.d.ts +3 -3
- package/dist/parsing/index.js +3 -141
- package/dist/parsing/lezer-tree.d.ts +2 -13
- package/dist/parsing/lezer-tree.js +50 -43
- package/dist/parsing/lezer-tree.js.map +1 -1
- package/dist/rslang/api.d.ts +9 -14
- package/dist/rslang/api.js +114 -827
- package/dist/rslang/api.js.map +1 -1
- package/dist/rslang/ast-annotations.d.ts +2 -18
- package/dist/rslang/ast-annotations.js +34 -45
- package/dist/rslang/ast-annotations.js.map +1 -1
- package/dist/rslang/error.d.ts +2 -85
- package/dist/rslang/error.js +88 -150
- package/dist/rslang/error.js.map +1 -1
- package/dist/rslang/eval/calculator.d.ts +2 -43
- package/dist/rslang/eval/calculator.js +81 -1636
- package/dist/rslang/eval/calculator.js.map +1 -1
- package/dist/rslang/eval/evaluation-cache.d.ts +22 -26
- package/dist/rslang/eval/evaluation-cache.js +168 -287
- package/dist/rslang/eval/evaluation-cache.js.map +1 -1
- package/dist/rslang/eval/evaluator.d.ts +59 -63
- package/dist/rslang/eval/evaluator.js +602 -1509
- package/dist/rslang/eval/evaluator.js.map +1 -1
- package/dist/rslang/eval/value-api.d.ts +2 -48
- package/dist/rslang/eval/value-api.js +2 -490
- package/dist/rslang/eval/value.d.ts +2 -36
- package/dist/rslang/eval/value.js +2 -118
- package/dist/rslang/index.d.ts +14 -17
- package/dist/rslang/index.js +12 -4314
- package/dist/rslang/labels.d.ts +6 -6
- package/dist/rslang/labels.js +139 -305
- package/dist/rslang/labels.js.map +1 -1
- package/dist/rslang/parser/expression-generator.d.ts +5 -5
- package/dist/rslang/parser/expression-generator.js +248 -446
- package/dist/rslang/parser/expression-generator.js.map +1 -1
- package/dist/rslang/parser/normalize.d.ts +4 -8
- package/dist/rslang/parser/normalize.js +286 -481
- package/dist/rslang/parser/normalize.js.map +1 -1
- package/dist/rslang/parser/parser.d.ts +2 -5
- package/dist/rslang/parser/parser.js +30 -21
- package/dist/rslang/parser/parser.js.map +1 -1
- package/dist/rslang/parser/parser.terms.d.ts +43 -41
- package/dist/rslang/parser/parser.terms.js +44 -83
- package/dist/rslang/parser/parser.terms.js.map +1 -1
- package/dist/rslang/parser/syntax-errors.d.ts +5 -8
- package/dist/rslang/parser/syntax-errors.js +113 -382
- package/dist/rslang/parser/syntax-errors.js.map +1 -1
- package/dist/rslang/parser/token.d.ts +2 -79
- package/dist/rslang/parser/token.js +81 -93
- package/dist/rslang/parser/token.js.map +1 -1
- package/dist/rslang/semantic/analyzer.d.ts +2 -39
- package/dist/rslang/semantic/analyzer.js +186 -2600
- package/dist/rslang/semantic/analyzer.js.map +1 -1
- package/dist/rslang/semantic/arguments-extractor.d.ts +2 -42
- package/dist/rslang/semantic/arguments-extractor.js +202 -361
- package/dist/rslang/semantic/arguments-extractor.js.map +1 -1
- package/dist/rslang/semantic/type-auditor.d.ts +64 -68
- package/dist/rslang/semantic/type-auditor.js +594 -1564
- package/dist/rslang/semantic/type-auditor.js.map +1 -1
- package/dist/rslang/semantic/typification-api.d.ts +4 -7
- package/dist/rslang/semantic/typification-api.js +162 -303
- package/dist/rslang/semantic/typification-api.js.map +1 -1
- package/dist/rslang/semantic/typification-parser.d.ts +2 -12
- package/dist/rslang/semantic/typification-parser.js +165 -219
- package/dist/rslang/semantic/typification-parser.js.map +1 -1
- package/dist/rslang/semantic/typification.d.ts +2 -119
- package/dist/rslang/semantic/typification.js +66 -52
- package/dist/rslang/semantic/typification.js.map +1 -1
- package/dist/rslang/semantic/value-auditor.d.ts +32 -38
- package/dist/rslang/semantic/value-auditor.js +206 -518
- package/dist/rslang/semantic/value-auditor.js.map +1 -1
- package/dist/rslang/semantic/value-class.d.ts +2 -10
- package/dist/rslang/semantic/value-class.js +8 -7
- package/dist/rslang/semantic/value-class.js.map +1 -1
- package/dist/rslang/typification-graph.d.ts +2 -33
- package/dist/rslang/typification-graph.js +94 -306
- package/dist/rslang/typification-graph.js.map +1 -1
- package/dist/shared/branded.d.ts +2 -7
- package/dist/shared/branded.js +1 -1
- package/dist/shared/hash.d.ts +2 -6
- package/dist/shared/hash.js +13 -13
- package/dist/shared/hash.js.map +1 -1
- package/dist/shared/index.d.ts +3 -2
- package/dist/shared/index.js +2 -18
- package/dist/token-DeXAmzwr.d.ts +81 -0
- package/dist/typification-Dk-fisgO.d.ts +120 -0
- package/dist/typification-graph-6HcZ-rKH.d.ts +30 -0
- package/dist/typification-parser-BBVx1RxP.d.ts +13 -0
- package/dist/value-B8UtCqaK.js +366 -0
- package/dist/value-B8UtCqaK.js.map +1 -0
- package/dist/value-CTjX6825.d.ts +33 -0
- package/dist/value-api-Bw-SgaYY.d.ts +49 -0
- package/dist/value-class-CNI-lqXJ.d.ts +12 -0
- package/package.json +8 -8
- package/src/library/oss-api.test.ts +76 -0
- package/src/library/oss-api.ts +4 -1
- package/src/library/rsform-api.test.ts +24 -0
- package/src/library/rsform-api.ts +12 -4
- package/dist/cctext/index.js.map +0 -1
- package/dist/graph/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/library/index.js.map +0 -1
- package/dist/library/oss-layout.js.map +0 -1
- package/dist/parsing/index.js.map +0 -1
- package/dist/rslang/eval/value-api.js.map +0 -1
- package/dist/rslang/eval/value.js.map +0 -1
- package/dist/rslang/index.js.map +0 -1
- package/dist/shared/branded.js.map +0 -1
- package/dist/shared/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ The root entry (`@rsconcept/domain`) re-exports the most common names. Subpath i
|
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
38
|
npm run generate # regenerates Lezer parser from rslang.grammar
|
|
39
|
-
npm run build # produces ./dist via
|
|
39
|
+
npm run build # produces ./dist via tsdown
|
|
40
40
|
npm test # vitest run
|
|
41
41
|
npm run typecheck # tsc --noEmit
|
|
42
42
|
npm run lint # ESLint (TypeScript; same core rules as frontend, no React)
|
|
@@ -46,9 +46,9 @@ npm run format:check
|
|
|
46
46
|
|
|
47
47
|
After editing `src/rslang/parser/rslang.grammar`, always run `npm run generate` before committing.
|
|
48
48
|
|
|
49
|
-
##
|
|
49
|
+
## Publishing
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Maintainers: see [PUBLISHING.md](./PUBLISHING.md) for npm release steps.
|
|
52
52
|
|
|
53
53
|
## License
|
|
54
54
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { t as AstNode } from "./ast-C8sIpKdL.js";
|
|
2
|
+
import { f as ExpressionType, g as TypeClass } from "./typification-Dk-fisgO.js";
|
|
3
|
+
import { i as RSErrorDescription } from "./error-E1LVq_3w.js";
|
|
4
|
+
import { t as ValueClass } from "./value-class-CNI-lqXJ.js";
|
|
5
|
+
|
|
6
|
+
//#region src/rslang/semantic/analyzer.d.ts
|
|
7
|
+
interface AnalysisBase {
|
|
8
|
+
success: boolean;
|
|
9
|
+
type: ExpressionType | null;
|
|
10
|
+
valueClass: ValueClass | null;
|
|
11
|
+
}
|
|
12
|
+
interface AnalysisFast extends AnalysisBase {
|
|
13
|
+
ast: AstNode | null;
|
|
14
|
+
}
|
|
15
|
+
interface AnalysisFull extends AnalysisBase {
|
|
16
|
+
ast: AstNode | null;
|
|
17
|
+
errors: RSErrorDescription[];
|
|
18
|
+
}
|
|
19
|
+
interface AnalysisOptions {
|
|
20
|
+
expected?: TypeClass;
|
|
21
|
+
isDomain?: boolean;
|
|
22
|
+
annotateTypes?: boolean;
|
|
23
|
+
annotateErrors?: boolean;
|
|
24
|
+
}
|
|
25
|
+
declare class RSLangAnalyzer {
|
|
26
|
+
private typeContext;
|
|
27
|
+
private valueContext;
|
|
28
|
+
private typeAuditor;
|
|
29
|
+
private valueAuditor;
|
|
30
|
+
addBase(alias: string, isNumeric?: boolean, valueClass?: ValueClass): void;
|
|
31
|
+
setGlobal(alias: string, type: ExpressionType | null, value: ValueClass | null): void;
|
|
32
|
+
getType(alias: string): ExpressionType | null;
|
|
33
|
+
checkFast(expression: string, options?: AnalysisOptions): AnalysisFast;
|
|
34
|
+
checkFull(expression: string, options?: AnalysisOptions): AnalysisFull;
|
|
35
|
+
private parse;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { RSLangAnalyzer as a, AnalysisOptions as i, AnalysisFast as n, AnalysisFull as r, AnalysisBase as t };
|
|
39
|
+
//# sourceMappingURL=analyzer-DlSq3Y3r.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { t as AstNode } from "./ast-C8sIpKdL.js";
|
|
2
|
+
import { f as ExpressionType } from "./typification-Dk-fisgO.js";
|
|
3
|
+
|
|
4
|
+
//#region src/rslang/semantic/arguments-extractor.d.ts
|
|
5
|
+
/** Represents function argument definition. */
|
|
6
|
+
interface ArgumentsType {
|
|
7
|
+
alias: string;
|
|
8
|
+
type: ExpressionType | null;
|
|
9
|
+
}
|
|
10
|
+
/** Type auditor for AST type checking.
|
|
11
|
+
* Warning! Assumes that the AST is well-formed and annotated with types.
|
|
12
|
+
*/
|
|
13
|
+
declare class ArgumentsExtractor {
|
|
14
|
+
private locals;
|
|
15
|
+
private result;
|
|
16
|
+
run(ast: AstNode): ArgumentsType[];
|
|
17
|
+
private dispatchDeclare;
|
|
18
|
+
private processDeclare;
|
|
19
|
+
private declareLocal;
|
|
20
|
+
private declareTuple;
|
|
21
|
+
private declareEnumeration;
|
|
22
|
+
private dispatchVisit;
|
|
23
|
+
private processVisit;
|
|
24
|
+
private visitChild;
|
|
25
|
+
private visitChildDeclaration;
|
|
26
|
+
private visitAllAndReturn;
|
|
27
|
+
private visitLocal;
|
|
28
|
+
private visitFunctionDefinition;
|
|
29
|
+
private visitFunctionCall;
|
|
30
|
+
private visitArgument;
|
|
31
|
+
private visitQuantifier;
|
|
32
|
+
private visitImperative;
|
|
33
|
+
private visitIterate;
|
|
34
|
+
private visitRecursion;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { ArgumentsType as n, ArgumentsExtractor as t };
|
|
38
|
+
//# sourceMappingURL=arguments-extractor-1acwjQNc.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { n as TreeCursor } from "./lezer-tree-iS7LpLBJ.js";
|
|
2
|
+
|
|
3
|
+
//#region src/parsing/ast.d.ts
|
|
4
|
+
declare const TOKEN_ERROR = 0;
|
|
5
|
+
/** Represents AST node data. */
|
|
6
|
+
interface AstNodeData extends Record<string, unknown> {
|
|
7
|
+
dataType: string;
|
|
8
|
+
value: unknown;
|
|
9
|
+
}
|
|
10
|
+
/** Represents AST structured node base. */
|
|
11
|
+
interface AstNodeBase {
|
|
12
|
+
typeID: number;
|
|
13
|
+
data: AstNodeData;
|
|
14
|
+
annotation?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
/** Represents AST structured node. */
|
|
17
|
+
interface AstNode extends Record<string, unknown>, AstNodeBase {
|
|
18
|
+
uid: number;
|
|
19
|
+
from: number;
|
|
20
|
+
to: number;
|
|
21
|
+
hasError: boolean;
|
|
22
|
+
parenthesis?: boolean;
|
|
23
|
+
parent: AstNode | null;
|
|
24
|
+
children: AstNode[];
|
|
25
|
+
}
|
|
26
|
+
/** Represents AST node. */
|
|
27
|
+
interface FlatAstNode extends Record<string, unknown>, AstNodeBase {
|
|
28
|
+
uid: number;
|
|
29
|
+
parent: number | null;
|
|
30
|
+
from: number;
|
|
31
|
+
to: number;
|
|
32
|
+
}
|
|
33
|
+
/** Represents Syntax tree flat representation. */
|
|
34
|
+
type FlatAST = FlatAstNode[];
|
|
35
|
+
/** Builds AST tree from a given tree cursor, generating unique uids for each node. */
|
|
36
|
+
declare function buildTree(cursor: TreeCursor): AstNode;
|
|
37
|
+
/** Flattens AST tree to a array form. */
|
|
38
|
+
declare function flattenAst(node: AstNode, parent?: number | null, out?: FlatAST): FlatAST;
|
|
39
|
+
/** Visits AST tree in depth-first order. */
|
|
40
|
+
declare function visitAstDFS(node: AstNode, callback: (node: AstNode) => void): void;
|
|
41
|
+
/** Finds and returns the AstNode with the given ui. */
|
|
42
|
+
declare function findByUid(root: AstNode, uid: number): AstNode | null;
|
|
43
|
+
/** Prints AST tree. */
|
|
44
|
+
declare function printAst(node: AstNode, printNode: (node: AstNode) => string): string;
|
|
45
|
+
/** Extracts node text. */
|
|
46
|
+
declare function getNodeText(node: AstNode): string;
|
|
47
|
+
/** Extracts node indices. */
|
|
48
|
+
declare function getNodeIndices(node: AstNode): number[];
|
|
49
|
+
//#endregion
|
|
50
|
+
export { TOKEN_ERROR as a, flattenAst as c, printAst as d, visitAstDFS as f, FlatAstNode as i, getNodeIndices as l, AstNodeBase as n, buildTree as o, FlatAST as r, findByUid as s, AstNode as t, getNodeText as u };
|
|
51
|
+
//# sourceMappingURL=ast-C8sIpKdL.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as AstNode } from "./ast-C8sIpKdL.js";
|
|
2
|
+
import { f as ExpressionType } from "./typification-Dk-fisgO.js";
|
|
3
|
+
import { a as RSErrorInfo, r as RSErrorCode } from "./error-E1LVq_3w.js";
|
|
4
|
+
|
|
5
|
+
//#region src/rslang/ast-annotations.d.ts
|
|
6
|
+
/** Appends {@link ExpressionType} onto the node's `annotation.rsType`. */
|
|
7
|
+
declare function annotateType(node: AstNode, type: ExpressionType): void;
|
|
8
|
+
/** Reads {@link ExpressionType} from node's `annotation`. */
|
|
9
|
+
declare function readTypeAnnotation(node: AstNode): ExpressionType | null;
|
|
10
|
+
/** Appends {@link RSErrorInfo} onto the node's `annotation.rsErrors` if not already set. */
|
|
11
|
+
declare function annotateError(node: AstNode, code: RSErrorCode, params?: readonly string[]): void;
|
|
12
|
+
/** Reads validated {@link RSErrorInfo} entry from node's `annotation`. */
|
|
13
|
+
declare function readErrorAnnotation(node: AstNode): RSErrorInfo | null;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { readTypeAnnotation as i, annotateType as n, readErrorAnnotation as r, annotateError as t };
|
|
16
|
+
//# sourceMappingURL=ast-annotations-BiMjkKvz.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/shared/branded.d.ts
|
|
2
|
+
declare const brand: unique symbol;
|
|
3
|
+
/** Branded strict type. No runtime consequences. */
|
|
4
|
+
type Branded<T, BrandT> = T & {
|
|
5
|
+
readonly [brand]: BrandT;
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { Branded as t };
|
|
9
|
+
//# sourceMappingURL=branded-ZlzIcxzu.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { t as AstNode } from "./ast-C8sIpKdL.js";
|
|
2
|
+
import { f as ExpressionType } from "./typification-Dk-fisgO.js";
|
|
3
|
+
import { i as RSErrorDescription } from "./error-E1LVq_3w.js";
|
|
4
|
+
import { c as Value } from "./value-CTjX6825.js";
|
|
5
|
+
|
|
6
|
+
//#region src/rslang/eval/calculator.d.ts
|
|
7
|
+
/** Result of calculator evaluation. */
|
|
8
|
+
interface CalculatorResult {
|
|
9
|
+
value: Value | null;
|
|
10
|
+
iterations: number;
|
|
11
|
+
cacheHits: number;
|
|
12
|
+
errors: RSErrorDescription[];
|
|
13
|
+
}
|
|
14
|
+
/** Options for {@link RSCalculator.evaluateFull}. */
|
|
15
|
+
interface CalculatorEvaluateOptions {
|
|
16
|
+
annotateErrors?: boolean;
|
|
17
|
+
disableCache?: boolean;
|
|
18
|
+
}
|
|
19
|
+
type Listener = () => void;
|
|
20
|
+
/** AST calculator - evaluates RS expressions via visitor pattern and provides updates via listeners. */
|
|
21
|
+
declare class RSCalculator {
|
|
22
|
+
private context;
|
|
23
|
+
private treeContext;
|
|
24
|
+
private evaluator;
|
|
25
|
+
private listeners;
|
|
26
|
+
subscribe: (alias: string, listener: Listener) => () => void;
|
|
27
|
+
setValue(alias: string, value: Value): void;
|
|
28
|
+
resetValue(alias: string): void;
|
|
29
|
+
clearAllAst(): void;
|
|
30
|
+
getValue(alias: string): Value | null;
|
|
31
|
+
setAST(alias: string, ast: AstNode): void;
|
|
32
|
+
validate(value: Value, type: ExpressionType): boolean;
|
|
33
|
+
evaluateFast(ast: AstNode): Value | null;
|
|
34
|
+
evaluateFull(ast: AstNode, options?: CalculatorEvaluateOptions): CalculatorResult;
|
|
35
|
+
private notify;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { CalculatorResult as n, RSCalculator as r, CalculatorEvaluateOptions as t };
|
|
39
|
+
//# sourceMappingURL=calculator-C9W2jkSx.d.ts.map
|
package/dist/cctext/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { EntityReference, Grammeme, ReferenceType, SyntacticReference, TermContext, WordForm, supportedGrammemes } from "./language.js";
|
|
2
|
+
export { type EntityReference, Grammeme, ReferenceType, type SyntacticReference, type TermContext, type WordForm, supportedGrammemes };
|
package/dist/cctext/index.js
CHANGED
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// Число
|
|
4
|
-
sing: "sing",
|
|
5
|
-
plur: "plur",
|
|
6
|
-
// Падеж
|
|
7
|
-
nomn: "nomn",
|
|
8
|
-
gent: "gent",
|
|
9
|
-
datv: "datv",
|
|
10
|
-
accs: "accs",
|
|
11
|
-
ablt: "ablt",
|
|
12
|
-
loct: "loct"
|
|
13
|
-
};
|
|
14
|
-
var Case = [
|
|
15
|
-
Grammeme.nomn,
|
|
16
|
-
Grammeme.gent,
|
|
17
|
-
Grammeme.datv,
|
|
18
|
-
Grammeme.accs,
|
|
19
|
-
Grammeme.ablt,
|
|
20
|
-
Grammeme.loct
|
|
21
|
-
];
|
|
22
|
-
var Plurality = [Grammeme.sing, Grammeme.plur];
|
|
23
|
-
var supportedGrammemes = [
|
|
24
|
-
Grammeme.sing,
|
|
25
|
-
Grammeme.plur,
|
|
26
|
-
Grammeme.nomn,
|
|
27
|
-
Grammeme.gent,
|
|
28
|
-
Grammeme.datv,
|
|
29
|
-
Grammeme.accs,
|
|
30
|
-
Grammeme.ablt,
|
|
31
|
-
Grammeme.loct
|
|
32
|
-
];
|
|
33
|
-
var ReferenceType = {
|
|
34
|
-
ENTITY: "entity",
|
|
35
|
-
SYNTACTIC: "syntax"
|
|
36
|
-
};
|
|
37
|
-
export {
|
|
38
|
-
Grammeme,
|
|
39
|
-
ReferenceType,
|
|
40
|
-
supportedGrammemes
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { Grammeme, ReferenceType, supportedGrammemes } from "./language.js";
|
|
2
|
+
export { Grammeme, ReferenceType, supportedGrammemes };
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { EntityReference, Grammeme, IReference, SyntacticReference, TermContext, WordForm } from
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Module: Natural language model API.
|
|
5
|
-
*/
|
|
1
|
+
import { EntityReference, Grammeme, IReference, SyntacticReference, TermContext, WordForm } from "./language.js";
|
|
6
2
|
|
|
3
|
+
//#region src/cctext/language-api.d.ts
|
|
7
4
|
/** Represents generated lexeme forms. */
|
|
8
5
|
interface Lexeme {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
items: {
|
|
7
|
+
text: string;
|
|
8
|
+
grams: string;
|
|
9
|
+
}[];
|
|
13
10
|
}
|
|
14
11
|
/** Equality comparator for {@link WordForm}. Compares a set of Grammemes attached to wordforms. */
|
|
15
12
|
declare function wordFormEquals(left: WordForm, right: WordForm): boolean;
|
|
@@ -17,7 +14,7 @@ declare function wordFormEquals(left: WordForm, right: WordForm): boolean;
|
|
|
17
14
|
declare function parseGrammemes(termForm: string): Grammeme[];
|
|
18
15
|
/** Generates all supported noun forms using nominal text for every form. */
|
|
19
16
|
declare function generateNominalLexeme(data: {
|
|
20
|
-
|
|
17
|
+
text: string;
|
|
21
18
|
}): Lexeme;
|
|
22
19
|
/**
|
|
23
20
|
* Extracts {@link EntityReference} from string representation.
|
|
@@ -39,5 +36,6 @@ declare function extractEntities(text: string): string[];
|
|
|
39
36
|
declare function resolveTextReferences(text: string, context: TermContext): string;
|
|
40
37
|
/** Transforms {@link IReference} to string representation. */
|
|
41
38
|
declare function referenceToString(ref: IReference): string;
|
|
42
|
-
|
|
43
|
-
export {
|
|
39
|
+
//#endregion
|
|
40
|
+
export { Lexeme, extractEntities, generateNominalLexeme, parseEntityReference, parseGrammemes, parseReference, parseSyntacticReference, referenceToString, resolveTextReferences, wordFormEquals };
|
|
41
|
+
//# sourceMappingURL=language-api.d.ts.map
|