A single tree node that may form part of a ’gram. PQGrams include
filler labels for absent nodes in either dimension (usual notation is ‘’)
so this enum lets the PQgram profile contain either while allowing literal
‘’ as a label.
ValidGramElement contains all the traits required of a PQGram member element.
This approach DRYs up the code and keeps it tidy, but requires implementors
to add an empty impl ValidGramElement for T {} block before impl’ing
LabelledTree for the Tree container.
PQGrams are nested structures of ancestors and siblings, but their intended use
is usually as flat vectors of constant length. This converts all PQGram elements
in a profile into flat vectors.
Calculates PQGram distance between two profiles, using the default_gram_edit_distance function.
All notes for pqgram_distance_with_fn apply here, particularly with respect to alt_filler_value!
Given two sorted PQGram profiles, return a float value representing their distance, using
the provided distance function to provide a 0..1 measure of similarity between PQGrams.
If alt_filler_value is None, then the Default for type L is used to fill in Node::Filler
elements in the PQGrams before ordering. When the Default for L is a value that also occurs
in a valid tree (often the case!), you should provide an Value here that does not occur
in the tree.