weaviate-client
Version:
JS/TS client for Weaviate
29 lines (28 loc) • 1.39 kB
TypeScript
import { Stopwords, Tokenization } from '../collections/types/index.js';
import ConnectionGRPC from '../connection/grpc.js';
import { DbVersionSupport } from '../utils/dbVersion.js';
import { TextAnalyzerConfig, TokenizeResult } from './types.js';
declare const tokenize: (connection: ConnectionGRPC, dbVersionSupport: DbVersionSupport) => Tokenize;
export interface Tokenize {
text: (text: string, tokenization: Tokenization, opts?: {
analyzerConfig?: TextAnalyzerConfig;
/**
* One-off stopwords block applied directly to this request. Mirrors the
* collection-level `invertedIndexConfig.stopwords` shape (preset +
* additions + removals). Mutually exclusive with `stopwordPresets`.
*/
stopwords?: Partial<Stopwords>;
/**
* User-defined named stopword lists. Keyed by preset name; each value is a
* flat array of stopword strings. Mirrors the wire format accepted by
* Weaviate's `/v1/tokenize` endpoint (>= v1.37.2) and the schema-level
* `invertedIndexConfig.stopwordPresets`. Mutually exclusive with
* `stopwords`.
*/
stopwordPresets?: {
[presetName: string]: string[];
};
}) => Promise<TokenizeResult>;
forProperty: (collection: string, property: string, text: string) => Promise<TokenizeResult>;
}
export default tokenize;