# Generated by SnakeBridge v0.16.0 - DO NOT EDIT MANUALLY # Regenerate with: mix compile # Library: dspy 3.2.0 # Python module: dspy.utils # Python class: DummyVectorizer defmodule Dspy.Utils.DummyVectorizer do @moduledoc """ Simple vectorizer based on n-grams. """ def __snakebridge_python_name__, do: "dspy.utils" def __snakebridge_python_class__, do: "DummyVectorizer" def __snakebridge_library__, do: "dspy" @opaque t :: SnakeBridge.Ref.t() @doc """ Initialize self. See help(type(self)) for accurate signature. ## Parameters - `max_length` (term() default: 100) - `n_gram` (term() default: 2) """ @spec new(list(term()), keyword()) :: {:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()} def new(args, opts \\ []) do {args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts) SnakeBridge.Runtime.call_class(__MODULE__, :__init__, [] ++ List.wrap(args), opts) end @doc """ Hashes a string using a polynomial hash function. ## Parameters - `gram` (term()) ## Returns - `term()` """ @spec _hash(SnakeBridge.Ref.t(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def _hash(ref, gram, opts \\ []) do SnakeBridge.Runtime.call_method(ref, :_hash, [gram], opts) end end