Skip to content

Detect ages written as spelled-out numbers #57

Description

@jzonthemtn

The age filter detects numeric ages only. Ages written as spelled-out numbers are not detected:

the patient is thirty-five years old
a thirty-five-year-old patient
she is aged forty-two
he is one hundred years old

Java added these in 4.0.0. It builds a number-word fragment covering 0 to about 119 (ones, teens, tens optionally followed by a ones word, and an optional (one|a) hundred (and)? prefix) and uses it in two patterns: the spelled-out equivalent of N years old and of age N. See AgeFilter in philterd/phileas for the reference implementation.

Acceptance Criteria

  • thirty-five years old, thirty-five-year-old, aged forty-two, and one hundred years old are detected
  • Hyphenated and space-separated compound numbers both work (thirty-five, forty two)
  • The spelled-out form works with the age/aged keyword as well as the years old phrasing
  • A phrase such as she left five years ago is not redacted as an age
  • Detection is case-insensitive
  • Tests cover the spelled-out forms in tests/test_age_detection.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions