tycho-components 0.2.0-SNAPSHOT-11 → 0.2.0-SNAPSHOT-13

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.
@@ -8,6 +8,7 @@ import SentenceUtils from '../functions/SentenceUtils';
8
8
  import CytoscapeTreeConverter from './cytoscape/CytoscapeTreeConverter';
9
9
  import SyntreesCytoscape from './cytoscape/SyntreesCytoscape';
10
10
  import './style.scss';
11
+ import AppPlaceholder from '../AppPlaceholder';
11
12
  export default function TreeView({ struct, expression, onExpand, selector = 'canvas-tree', translations, }) {
12
13
  const { t } = useTranslation('tree');
13
14
  const [cy, setCy] = useState(null);
@@ -65,6 +66,9 @@ export default function TreeView({ struct, expression, onExpand, selector = 'can
65
66
  useEffect(() => {
66
67
  load();
67
68
  }, [struct]);
69
+ if (!struct.chunks || struct.chunks.length === 0) {
70
+ return _jsx(AppPlaceholder, { text: t('placeholder.sentence.notparsed') });
71
+ }
68
72
  return (_jsxs("div", { className: "tree-view-container", children: [cy &&
69
73
  getButtons(generateImage, reset, downloadPsd, displayInfo, onExpand, expression)
70
74
  .filter((btn) => btn.condition)
@@ -1,2 +1,3 @@
1
1
  import { Struct } from '../../configs/types/Struct';
2
2
  export declare const structExample: Struct;
3
+ export declare const structNotParsedExample: Struct;
@@ -259,3 +259,196 @@ export const structExample = {
259
259
  document: 'D388',
260
260
  page: 'P7029',
261
261
  };
262
+ export const structNotParsedExample = {
263
+ uid: '13e0ee30-8f07-11e6-b457-90b11c409ded',
264
+ tokens: [
265
+ {
266
+ attributes: {
267
+ 'gloss-br': 'agora',
268
+ gloss: 'now',
269
+ },
270
+ p: 1,
271
+ v: 'natigide',
272
+ t: 'ADV',
273
+ l: 1,
274
+ },
275
+ {
276
+ splits: [
277
+ {
278
+ attributes: {
279
+ 'gloss-br': 'Ant',
280
+ gloss: 'Ant',
281
+ },
282
+ v: 'n',
283
+ t: 'Ant',
284
+ },
285
+ {
286
+ attributes: {
287
+ 'gloss-br': 'história',
288
+ gloss: 'history',
289
+ },
290
+ v: 'atema',
291
+ t: 'n',
292
+ },
293
+ {
294
+ attributes: {
295
+ 'gloss-br': 'de',
296
+ gloss: 'of',
297
+ },
298
+ v: 'tigi',
299
+ t: 'Apl',
300
+ },
301
+ ],
302
+ attributes: {
303
+ 'gloss-br': 'história',
304
+ },
305
+ p: 2,
306
+ v: 'natematigi',
307
+ t: 'N$',
308
+ l: 2,
309
+ },
310
+ {
311
+ splits: [
312
+ {
313
+ attributes: {
314
+ 'gloss-br': 'fem',
315
+ gloss: 'fem',
316
+ },
317
+ v: 'a',
318
+ t: 'Gnr',
319
+ },
320
+ {
321
+ attributes: {
322
+ 'gloss-br': 'ausente',
323
+ gloss: 'absent',
324
+ },
325
+ v: 'ca',
326
+ t: 'Ncl',
327
+ },
328
+ {
329
+ attributes: {
330
+ 'gloss-br': 'Hon',
331
+ gloss: 'Hon',
332
+ },
333
+ v: 'wa',
334
+ t: 'Hon',
335
+ },
336
+ ],
337
+ attributes: {
338
+ 'gloss-br': 'uma',
339
+ },
340
+ p: 3,
341
+ v: 'acoa',
342
+ t: 'D',
343
+ l: 1,
344
+ },
345
+ {
346
+ splits: [
347
+ {
348
+ attributes: {
349
+ 'gloss-br': 'mulher',
350
+ gloss: 'woman',
351
+ },
352
+ v: 'iwalo',
353
+ t: 'n',
354
+ },
355
+ ],
356
+ attributes: {
357
+ 'gloss-br': 'mulher',
358
+ },
359
+ p: 4,
360
+ v: 'iwaalo',
361
+ t: 'N',
362
+ l: 1,
363
+ },
364
+ {
365
+ attributes: {
366
+ 'gloss-br': 'que ',
367
+ },
368
+ p: 5,
369
+ v: 'ane',
370
+ t: 'WPRO',
371
+ l: 3,
372
+ },
373
+ {
374
+ p: 6,
375
+ v: '*T*',
376
+ l: 4,
377
+ ec: true,
378
+ coidx: [1],
379
+ },
380
+ {
381
+ splits: [
382
+ {
383
+ v: 'di',
384
+ t: 'Inv',
385
+ },
386
+ {
387
+ v: 'n',
388
+ t: 'Ref',
389
+ },
390
+ {
391
+ attributes: {
392
+ 'gloss-br': 'virar',
393
+ gloss: 'turn',
394
+ },
395
+ v: 'ana',
396
+ t: 'v',
397
+ },
398
+ {
399
+ attributes: {
400
+ 'gloss-br': 'para',
401
+ gloss: 'into',
402
+ },
403
+ v: 'tigi',
404
+ t: 'Apl',
405
+ },
406
+ ],
407
+ attributes: {
408
+ 'gloss-br': 'virava',
409
+ },
410
+ p: 7,
411
+ v: 'dinanatigi',
412
+ t: 'VBAPL',
413
+ l: 3,
414
+ },
415
+ {
416
+ attributes: {
417
+ 'gloss-br': 'que',
418
+ },
419
+ p: 8,
420
+ v: 'me',
421
+ t: 'C',
422
+ l: 4,
423
+ },
424
+ {
425
+ splits: [
426
+ {
427
+ attributes: {
428
+ 'gloss-br': 'onça',
429
+ gloss: 'jaguar',
430
+ },
431
+ v: 'nigediogo',
432
+ t: 'n',
433
+ },
434
+ ],
435
+ attributes: {
436
+ 'gloss-br': 'onça',
437
+ },
438
+ p: 9,
439
+ v: 'nigediogo',
440
+ t: 'N',
441
+ l: 6,
442
+ },
443
+ {
444
+ p: 10,
445
+ v: '.',
446
+ t: '.',
447
+ l: 0,
448
+ },
449
+ ],
450
+ chunks: [],
451
+ corpus: 'C12',
452
+ document: 'D388',
453
+ page: 'P7029',
454
+ };
@@ -138,6 +138,7 @@ export declare const commonResources: {
138
138
  'button.download.tree': string;
139
139
  'button.download.penn': string;
140
140
  'button.info': string;
141
+ 'placeholder.sentence.notparsed': string;
141
142
  };
142
143
  upload: {
143
144
  'label.dropzone': string;
@@ -283,6 +284,7 @@ export declare const commonResources: {
283
284
  'button.recenter.tree': string;
284
285
  'button.download.tree': string;
285
286
  'button.download.penn': string;
287
+ 'placeholder.sentence.notparsed': string;
286
288
  };
287
289
  upload: {
288
290
  'label.dropzone': string;
@@ -5,12 +5,14 @@ export declare const TreeTexts: {
5
5
  'button.download.tree': string;
6
6
  'button.download.penn': string;
7
7
  'button.info': string;
8
+ 'placeholder.sentence.notparsed': string;
8
9
  };
9
10
  'pt-BR': {
10
11
  'button.expand.tree': string;
11
12
  'button.recenter.tree': string;
12
13
  'button.download.tree': string;
13
14
  'button.download.penn': string;
15
+ 'placeholder.sentence.notparsed': string;
14
16
  };
15
17
  it: {
16
18
  'button.expand.tree': string;
@@ -5,12 +5,14 @@ export const TreeTexts = {
5
5
  'button.download.tree': 'Download tree as image',
6
6
  'button.download.penn': 'Download in Penn Tree format',
7
7
  'button.info': 'Display translations and glosses',
8
+ 'placeholder.sentence.notparsed': 'This sentence has not been parsed.',
8
9
  },
9
10
  'pt-BR': {
10
11
  'button.expand.tree': 'Expandir árvore',
11
12
  'button.recenter.tree': 'Recentralizar árvore',
12
13
  'button.download.tree': 'Baixar árvore como imagem',
13
14
  'button.download.penn': 'Baixar no formato Penn Tree',
15
+ 'placeholder.sentence.notparsed': 'O parser não foi realizado nesta sentença.',
14
16
  },
15
17
  it: {
16
18
  'button.expand.tree': 'Espandi albero',
@@ -0,0 +1,10 @@
1
+ export type SentenceStatus = 'DONE' | 'TODO' | 'IGNORE' | 'TAGGED' | 'REVIEW' | 'ERROR';
2
+ export declare const SentenceStatusNames: {
3
+ DONE: string;
4
+ TODO: string;
5
+ IGNORE: string;
6
+ TAGGED: string;
7
+ REVIEW: string;
8
+ ERROR: string;
9
+ };
10
+ export default SentenceStatus;
@@ -0,0 +1,8 @@
1
+ export const SentenceStatusNames = {
2
+ DONE: 'sentence.status.done',
3
+ TODO: 'sentence.status.todo',
4
+ IGNORE: 'sentence.status.ignore',
5
+ TAGGED: 'sentence.status.tagged',
6
+ REVIEW: 'sentence.status.review',
7
+ ERROR: 'sentence.status.error',
8
+ };
@@ -1,3 +1,4 @@
1
+ import SentenceStatus from './SentenceStatus';
1
2
  export type Split = {
2
3
  v: string;
3
4
  t: string;
@@ -9,6 +10,7 @@ export type Chunk = {
9
10
  l: number;
10
11
  t: string;
11
12
  coidx?: number[];
13
+ ep?: boolean;
12
14
  };
13
15
  export type Token = {
14
16
  p: number;
@@ -29,6 +31,7 @@ export type Token = {
29
31
  review?: boolean;
30
32
  edition?: Edition;
31
33
  format?: Format;
34
+ status?: SentenceStatus;
32
35
  };
33
36
  export type Morpheme = {
34
37
  v: string;
package/dist/index.d.ts CHANGED
@@ -31,6 +31,8 @@ export { commonResources } from './configs/Localization';
31
31
  export type { Corpus, Github } from './configs/types/Corpus';
32
32
  export { CorpusImageTypeNames } from './configs/types/CorpusImage';
33
33
  export type { CorpusImage, CorpusImageType } from './configs/types/CorpusImage';
34
+ export { SentenceStatusNames } from './configs/types/SentenceStatus';
35
+ export type { SentenceStatus } from './configs/types/SentenceStatus';
34
36
  export type { Chunk, Edition, Format, Morpheme, Split, Struct, Token, } from './configs/types/Struct';
35
37
  export type { CytoscapeTree, Tree } from './configs/types/Tree';
36
38
  export { UserStatusNames } from './configs/types/User';
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ export { default as HeaderNotifications } from './Comments/HeaderNotifications';
22
22
  export { CommonProvider } from './configs/CommonContext';
23
23
  export { commonResources } from './configs/Localization';
24
24
  export { CorpusImageTypeNames } from './configs/types/CorpusImage';
25
+ export { SentenceStatusNames } from './configs/types/SentenceStatus';
25
26
  export { UserStatusNames } from './configs/types/User';
26
27
  export { useCorpusUtils } from './configs/useCorpusUtils';
27
28
  export { useLoggedUtils } from './configs/useLoggedUtils';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.2.0-SNAPSHOT-11",
4
+ "version": "0.2.0-SNAPSHOT-13",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {