parse-ingredient - v3.0.0
    Preparing search index...

    Interface Measurement

    A quantity paired with a known unit of measure, found at a known position within some scanned text.

    interface Measurement {
        endIndex: number;
        quantity: number;
        quantity2: number | null;
        startIndex: number;
        text: string;
        unitOfMeasure: string;
        unitOfMeasureID: string;
        unitType: UnitType | null;
    }

    Hierarchy (View Summary)

    Index
    endIndex: number

    End-exclusive index of the measurement in the scanned text.

    quantity: number

    The primary quantity (the lower quantity in a range, if applicable).

    Always a finite, non-negative number — subject to the same constraints as Ingredient.quantity.

    quantity2: number | null

    The secondary quantity (the upper quantity in a range), or null if the measurement is not a range.

    startIndex: number

    Zero-based index of the measurement's first character in the scanned text.

    text: string

    The exact matched text. Always equal to text.slice(startIndex, endIndex) of the scanned text.

    unitOfMeasure: string

    The unit of measure as written, or the canonical ID when normalizeUOM is enabled.

    unitOfMeasureID: string

    The unit of measure identifier. Never null: a measurement is only reported when its unit is recognized.

    unitType: UnitType | null

    The unit's UnitOfMeasure.type, so the measurement can be filtered without a second lookup. null when the definition declares no type.