Skip to main content

TrigramWordSimilarity

This class provides a database function for calculating the trigram word similarity between two strings. It utilizes the WORD_SIMILARITY function to measure how similar the set of trigrams in the first string is to the most similar substring of the second string.

Attributes

AttributeTypeDescription
functionstring = "WORD_SIMILARITY"The database function name used to calculate the trigram word similarity between two strings.

Constructor

Signature

def TrigramWordSimilarity(
expression1: [Expression](../../../db/models/expressions/expression.md?sid=django_db_models_expressions_expression),
expression2: [Expression](../../../db/models/expressions/expression.md?sid=django_db_models_expressions_expression)
) - > null

Parameters

NameTypeDescription
expression1[Expression](../../../db/models/expressions/expression.md?sid=django_db_models_expressions_expression)The first string expression or column to compare.
expression2[Expression](../../../db/models/expressions/expression.md?sid=django_db_models_expressions_expression)The second string expression or column to compare.