Method MapOffset
- Namespace
- MailFathom.Application.SensitiveContent.Redaction
- Assembly
- MailFathom.Application.dll
MapOffset(int)
Finds where an offset into the text that was analyzed ended up in Text.
public int? MapOffset(int analyzedOffset)
Parameters
analyzedOffsetintThe offset in the text handed to the redaction.
Returns
Remarks
This is what lets an offset recorded against a text survive its redaction. A page boundary inside an attachment is such an offset, and without this every boundary of a document carrying one detected address would be dropped — a two-hundred-page contract losing every citation because a signature block held an email address.
An offset that fell inside a replaced region answers with the start of the placeholder that replaced it, which is the nearest position that still exists. An offset past what the ceiling admitted answers with nothing at all, because the text it pointed into is not in the result: a coordinate that says nothing is better than one that sends a reader to the wrong page.
Exceptions
- ArgumentOutOfRangeException
Thrown when
analyzedOffsetis negative.