Skip to content

Commit

Permalink
add function to extract replacementTerms
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Jeanneney committed Aug 30, 2024
1 parent a499a44 commit e4acd8b
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,22 @@ function buildAnonymizer<documentT extends fetchedDocumentType>(

return anonymizedText;
}

function extractReplacementTerms() {

Check failure on line 57 in packages/generic/core/src/lib/anonymizer/buildAnonymizer/buildAnonymizer.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

'extractReplacementTerms' is defined but never used
const uniqueAnnotationsText: {
[key: string]: { entityId: string; replacementTerm: string; category: string };
} = {};

annotations.forEach((annotation) => {
if (!uniqueAnnotationsText[annotation.text]) {
uniqueAnnotationsText[annotation.text] = {
entityId: annotation.entityId,
replacementTerm: mapper[annotation.entityId] || ANONYMIZATION_DEFAULT_TEXT,
category: annotation.category,
};
}
});

return uniqueAnnotationsText;
}
}

0 comments on commit e4acd8b

Please sign in to comment.