@openfloor/protocol - v0.0.4
    Preparing search index...

    Class TextFeature

    Specialized text feature with convenient string value handling. Automatically sets mimeType to 'text/plain' and provides a values convenience property.

    // Create from string values
    const textFeature = new TextFeature({ values: ['Hello', 'world'] });

    // Create with full token options
    const textFeature2 = new TextFeature({
    tokens: [{ value: 'Hello', confidence: 0.95 }],
    lang: 'en-US'
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    alternates: readonly (readonly Token[])[]
    encoding?: string
    lang?: string
    mimeType: string
    tokens: readonly Token[]
    tokenSchema?: string

    Methods

    • Convert to plain object for JSON serialization

      Returns Record<string, unknown>