med-pdf-nmo 0.1.0 → 0.1.2
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 +1 -0
- package/README.ru.md +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/med-pdf-nmo.browser.js +739 -91
- package/dist/med-pdf-nmo.browser.mjs +739 -91
- package/dist/pdf.d.ts +1 -1
- package/dist/pdf.js +7 -1
- package/dist/predictor/config.d.ts +2 -0
- package/dist/predictor/config.js +2 -0
- package/dist/predictor/scorer-registry.d.ts +28 -0
- package/dist/predictor/scorer-registry.js +290 -0
- package/dist/predictor/scorers/direction.d.ts +22 -0
- package/dist/predictor/scorers/direction.js +134 -0
- package/dist/predictor/scorers/drug-dose.js +36 -3
- package/dist/predictor/scorers/option-family.d.ts +59 -0
- package/dist/predictor/scorers/option-family.js +201 -0
- package/dist/predictor/scorers/recommendation-item.d.ts +12 -0
- package/dist/predictor/scorers/recommendation-item.js +63 -1
- package/dist/predictor/selection.js +1 -44
- package/dist/predictor.js +351 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -157,6 +157,7 @@ const result = await answerQuestion(pdf, {
|
|
|
157
157
|
- `mode`: alias for `type`.
|
|
158
158
|
- `cacheKey`: optional PDF text cache key.
|
|
159
159
|
- `pdfjsLib`: optional explicit PDF.js module override.
|
|
160
|
+
- `pdfVerbosity`: optional PDF.js logging level. By default only PDF.js errors are shown, so non-fatal font warnings such as `TT: undefined function` are suppressed.
|
|
160
161
|
|
|
161
162
|
Variants can be plain strings:
|
|
162
163
|
|
package/README.ru.md
CHANGED
|
@@ -157,6 +157,7 @@ const result = await answerQuestion(pdf, {
|
|
|
157
157
|
- `mode`: алиас для `type`.
|
|
158
158
|
- `cacheKey`: необязательный ключ кеша для текста PDF.
|
|
159
159
|
- `pdfjsLib`: необязательная явная передача PDF.js модуля.
|
|
160
|
+
- `pdfVerbosity`: необязательный уровень логирования PDF.js. По умолчанию показываются только ошибки PDF.js, поэтому нефатальные font warnings вроде `TT: undefined function` подавляются.
|
|
160
161
|
|
|
161
162
|
Варианты можно передавать строками:
|
|
162
163
|
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ export interface AnswerQuestionOptions {
|
|
|
41
41
|
cacheKey?: string;
|
|
42
42
|
/** Явно переданный модуль PDF.js, полезно для браузерного окружения. */
|
|
43
43
|
pdfjsLib?: any;
|
|
44
|
+
/** Уровень логирования PDF.js. По умолчанию показываются только ошибки. */
|
|
45
|
+
pdfVerbosity?: number;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Высокоуровневый результат, который возвращает {@link answerQuestion}.
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ export async function answerQuestion(pdf, options = { question: "" }) {
|
|
|
29
29
|
question: options.question,
|
|
30
30
|
answers,
|
|
31
31
|
mode: options.type ?? options.mode ?? "single",
|
|
32
|
-
}, { pdfjsLib: options.pdfjsLib });
|
|
32
|
+
}, { pdfjsLib: options.pdfjsLib, pdfVerbosity: options.pdfVerbosity });
|
|
33
33
|
const selectedAnswers = output.selected
|
|
34
34
|
.map((id) => answers.find((answer) => answer.id === id))
|
|
35
35
|
.filter(Boolean);
|