@mdgf11/filesystem-lib 2.2.13 → 2.2.15

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.
@@ -1,7 +1,8 @@
1
- import { PartialJurisprudenciaDocument } from "@stjiris/jurisprudencia-document";
1
+ import { JurisprudenciaDocument, PartialJurisprudenciaDocument } from "@stjiris/jurisprudencia-document";
2
2
  import { ContentType, FilesystemDocument } from "./types.js";
3
3
  export declare function writeFilesystemDocument(filesystem_document: FilesystemDocument): void;
4
4
  export declare function loadFilesystemDocument(jsonPath: string): FilesystemDocument;
5
+ export declare function loadNlpDocument(jurisprudencia_document: JurisprudenciaDocument): string;
5
6
  export declare function hasSelectableText(buffer: Buffer): Promise<boolean>;
6
7
  export declare function generateFilePath(jurisprudencia_document: PartialJurisprudenciaDocument): string;
7
8
  export declare function extractContent(contents: ContentType[]): Promise<string[]>;
@@ -54,6 +54,9 @@ export function loadFilesystemDocument(jsonPath) {
54
54
  }))
55
55
  };
56
56
  }
57
+ export function loadNlpDocument(jurisprudencia_document) {
58
+ return fs.readFileSync(`${generateFilePath(jurisprudencia_document)}/${ORIGINAL_NAME}.json`, 'utf-8');
59
+ }
57
60
  export async function hasSelectableText(buffer) {
58
61
  try {
59
62
  const uint8Array = new Uint8Array(buffer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdgf11/filesystem-lib",
3
- "version": "2.2.13",
3
+ "version": "2.2.15",
4
4
  "description": "Library to extend usage of jurisprudencia-document",
5
5
  "license": "ISC",
6
6
  "author": "Miguel Fonseca",
@@ -1,4 +1,4 @@
1
- import { PartialJurisprudenciaDocument } from "@stjiris/jurisprudencia-document";
1
+ import { JurisprudenciaDocument, PartialJurisprudenciaDocument } from "@stjiris/jurisprudencia-document";
2
2
  import fs from "fs";
3
3
  import mammoth from "mammoth";
4
4
  import { ContentType, Date_Area_Section, DETAILS_NAME, FILESYSTEM_PATH, FilesystemDocument, ORIGINAL_NAME, Retrievable_Metadata, ROOT_PATH, SHAREPOINT_COPY_PATH, Sharepoint_Metadata, SupportedUpdateSources } from "./types.js";
@@ -63,6 +63,12 @@ export function loadFilesystemDocument(jsonPath: string): FilesystemDocument {
63
63
  };
64
64
  }
65
65
 
66
+ export function loadNlpDocument(jurisprudencia_document: JurisprudenciaDocument): string {
67
+
68
+ return fs.readFileSync(`${generateFilePath(jurisprudencia_document)}/${ORIGINAL_NAME}.json`, 'utf-8');
69
+
70
+ }
71
+
66
72
  export async function hasSelectableText(buffer: Buffer): Promise<boolean> {
67
73
  try {
68
74
  const uint8Array = new Uint8Array(buffer);