Class: TopSecret::NullModel

Inherits:
Object
  • Object
show all
Defined in:
lib/top_secret/null_model.rb

Overview

A null object implementation that provides a no-op interface compatible with Mitie::NER. Used when NER filtering is disabled (model_path is nil) to eliminate conditional checks throughout the codebase.

Examples:

model = TopSecret::NullModel.new
doc = model.doc("some text")
doc.entities # => []

Defined Under Namespace

Classes: NullDoc

Instance Method Summary collapse

Instance Method Details

#doc(input) ⇒ NullDoc

Creates a null document that returns empty entities.

Parameters:

  • input (String)

    The input text (ignored)

Returns:

  • (NullDoc)

    A document-like object with empty entities



28
29
30
# File 'lib/top_secret/null_model.rb', line 28

def doc(input)
  NullDoc.new
end