% This LaTeX document was generated using the LaTeX backend of PlDoc,
% The SWI-Prolog documentation system



\section{library(isub): isub: a string similarity measure}

\label{sec:isub}

\begin{tags}
    \tag{author}
Giorgos Stoilos
    \tag{See also}
\textit{A string metric for ontology alignment} by Giorgos Stoilos,
2005.
\end{tags}

The \verb$library(isub)$ implements a similarity measure between strings, i.e.,
something similar to the \textit{Levenshtein distance}. This method is based
on the length of common substrings.\vspace{0.7cm}

\begin{description}
    \predicate[det]{isub}{4}{+Text1:text, +Text2:text, +Normalize:bool, -Similarity:float}
\arg{Similarity} is a measure for the distance between \arg{Text1} and
\arg{Text2}. E.g.

\begin{code}
?- isub('E56.Language', 'languange', true, D).
D = 0.711348.
\end{code}

If \arg{Normalize} is \const{true}, \predref{isub}{4} applies string normalization as
implemented by the original authors: \arg{Text1} and \arg{Text2} are mapped
to lowercase and the characters "._ " are removed. Lowercase
mapping is done with the C-library function \verb$towlower()$. In
general, the required normalization is domain dependent and is
better left to the caller. See e.g., \predref{unaccent_atom}{2}.

\begin{arguments}
\arg{Text1} & and \arg{Text2} are either an atom, string or a list of
characters or character codes. \\
\arg{Similarity} & is a float in the range [0.0..1.0], where 1.0
means \textit{most similar} \\
\end{arguments}
\end{description}

