class_docstr: Generate new examples by replacing words in examples.
  
  Substitutions must be of the form 'foo -> bar, spam -> eggs'.
class_docstr_tok: ["Generate","new","examples","by","replacing","words","in","examples",".","Substitutions","must","be","of","the","form","'foo","-",">","bar",",","spam","-",">","eggs","'","."]
code: def is_compatible(
      self, model: lit_model.Model, dataset: lit_dataset.Dataset
  ) -> bool:
      del model  # Unused by WordReplacer
      return utils.spec_contains(dataset.spec(), types.TextSegment)
  
file_path: lit/lit_nlp/components/word_replacer.py
imports: from collections.abc import Iterator, Sequence
  import re
  from typing import Optional
  from absl import logging
  from lit_nlp.api import components
  from lit_nlp.api import dataset
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.lib import utils
label_desc: Use image node_id 4 for calling the WordReplacer obj's underlying member method code with example usage: obj.is_compatible(model, dataset) and returns: utils