-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtree-node.component.ts
More file actions
34 lines (32 loc) · 961 Bytes
/
tree-node.component.ts
File metadata and controls
34 lines (32 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { Component, input } from '@angular/core';
import { SubscriptPipe } from '@/pipes/subscript-pipe';
import { SelectiveUpperCasePipe } from '@/pipes/selective-upper-case.pipe';
import { TreeType } from '../annotation-parse-results.component';
export interface TreeNodeDisplay {
type: 'node' | 'leaf' | 'var';
content?: string;
rule?: string;
children: TreeNodeDisplay[];
// For leaf nodes
leaf?: {
tok: string;
lem: string;
pos: string;
ner: string;
};
// For variable nodes
var?: {
typeInfo: string;
};
}
@Component({
selector: 'la-tree-node',
standalone: true,
imports: [SubscriptPipe, SelectiveUpperCasePipe],
templateUrl: './tree-node.component.html',
styleUrl: './tree-node.component.scss'
})
export class TreeNodeComponent {
public readonly node = input.required<TreeNodeDisplay>();
public readonly treeType = input.required<TreeType>();
}