WordGraph - SeqAn API Documentation

# Spec WordGraph
A special automaton that stores words instead of single characters along its edges.

Extends | Automaton
All Extended | Automaton, Graph
All Impl'd | AssignableConcept, ContainerConcept, DestructibleConcept
Defined in | <seqan/graph_type.h>
Signature | `template <[typename TAlphabet[, typename Spec]]> class Graph<Automaton<TAlphabet, String<TAlphabet>, WordGraph<TSpec> >;`

## Template Parameters

`TAlphabet` | The alphabet type.
`TSpec` | The specializing types.

## Member Function Overview

### Member Functions Inherited From AssignableConcept

- `operator=`

## Interface Function Overview

- `bool canParseString(a[, v], str);`
  Test whether an WordGraph can parse a string completely.
- `TVertexDescriptor getSuccessor(a, v, str);`
  Gets the successor for a given vertex and an edge label.
- `TVertexDescriptor parseString(a, v, beginIt, endIt);, TVertexDescriptor parseString(a, v, str);`
  Parses a string one character at a time and moves accordingly in the WordGraph.

### Interface Functions Inherited From Automaton

- `assignRoot`
- `canParseString`
- `createOracle`
- `createOracleOnReverse`
- `createRoot`
- `createSuffixTrie`
- `createTrie`
- `createTrieOnReverse`
- `getRoot`
- `getSuccessor`
- `isRoot`
- `parseString`
- `root`

### Interface Functions Inherited From Graph

- `addEdge`
- `addEdges`
- `addVertex`
- `assignEdgeMap`
- `assignVertexMap`
- `clear`
- `clearEdges`
- `clearVertices`
- `degree`
- `empty`
- `findEdge`
- `getAdjacencyMatrix`
- `getNil`
- `getVertexAdjacencyVector`
- `inDegree`
- `numEdges`
- `numVertices`
- `outDegree`
- `removeEdge`
- `removeInEdges`
- `removeOutEdges`
- `removeVertex`
- `resizeEdgeMap`
- `resizeVertexMap`
- `sourceVertex`
- `targetVertex`
- `transpose`
- `writeRecords`

### Interface Functions Inherited From AssignableConcept

- `assign`
- `set`
- `move`

### Interface Functions Inherited From ContainerConcept

- `writeValue`
- `write`
- `begin`
- `end`
- `length`
- `empty`
- `swap`
- `getObjectId`
- `moveValue`
- `append`
- `appendValue`
- `shrinkToFit`
- `directionIterator`

## Interface Metafunction Overview

### Interface Metafunctions Inherited From Graph

- `Cargo`
- `EdgeDescriptor`
- `EdgeIdHandler`
- `EdgeType`
- `Size`
- `VertexIdHandler`

### Interface Metafunctions Inherited From ContainerConcept

- `DefaultGetIteratorSpec`
- `DefaultIteratorSpec`
- `Difference`
- `DirectionIterator`
- `GetValue`
- `Iterator`
- `Position`
- `Reference`
- `Size`
- `Value`

## Interface Functions Detail

### `bool canParseString(a[, v], str);`

Test whether an WordGraph can parse a string completely.

#### Parameters

`a` | The WordGraph to use for parsing.
`v` | Optionally, the descriptor of the vertex to start at. Defaults to the root.
`str` | The string to parse.

#### Returns

`bool` | `true` if the WordGraph parses `str` , starting at `v`, completely and `false` otherwise.

#### Remarks

This has not implemented yet.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `TVertexDescriptor getSuccessor(a, v, str);`

Gets the successor for a given vertex and an edge label.

#### Parameters

`a` | The WordGraph to query for its successor.
`v` | The descriptor fo the vertex to get the successor for.
`str` | The label.

#### Returns

`TVertexDescriptor` | A vertex descriptor or nil if successor is not defined.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

#### See Also

- getNil
- parseString

### `TVertexDescriptor parseString(a, v, beginIt, endIt); TVertexDescriptor parseString(a, v, str);`

Parses a string one character at a time and moves accordingly in the WordGraph.

#### Parameters

`a` | An WordGraph.
`v` | The descriptor of the vertex to start at.
`str` | The ContainerConcept to parse.
`beginIt` | Begin iterator to sequence to parse. Set to the first character that could not be parsed or to the value of endIt if all of the string was parsed.
`endIt` | End iterator to sequence to parse.

#### Returns

`TVertexDescriptor` | The vertex descriptor of the state that was reached after parsing.

The parsing stops before getSuccessor reaches the nil state or if the complete sequence is read.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

#### Dox Sources

    /*!
     * @class WordGraph
     *
     * @extends Automaton
     *
     * @headerfile <seqan/graph_type.h>
     *
     * @brief A special automaton that stores words instead of single characters
     *        along its edges.
     *
     * @signature template <[typename TAlphabet[, typename Spec]]> class
     *            Graph<Automaton<TAlphabet, String<TAlphabet>, WordGraph<TSpec> >;
     *
     * @tparam TAlphabet The alphabet type.
     * @tparam TSpec The specializing types.
     *
     * @fn WordGraph#getSuccessor
     *
     * @brief Gets the successor for a given vertex and an edge label.
     *
     * @signature TVertexDescriptor getSuccessor(a, v, str);
     *
     * @param[in] a The WordGraph to query for its successor.
     * @param[in] v The descriptor fo the vertex to get the successor for.
     * @param[in] str The label.
     *
     * @return TVertexDescriptor A vertex descriptor or nil if successor is not
     *                           defined.
     *
     * @see WordGraph#parseString
     * @see Graph#getNil
     *
     * @fn WordGraph#parseString
     *
     * @brief Parses a string one character at a time and moves accordingly in the
     *        WordGraph.
     *
     * @signature TVertexDescriptor parseString(a, v, beginIt, endIt);
     * @signature TVertexDescriptor parseString(a, v, str);
     *
     * @param[in] a An WordGraph.
     * @param[in] v The descriptor of the vertex to start at.
     * @param[in] str The @link ContainerConcept @endlink to parse.
     * @param[in,out] beginIt Begin iterator to sequence to parse. Set to the first
     *                        character that could not be parsed or to the value of
     *                        endIt if all of the string was parsed.
     * @param[in] endIt End iterator to sequence to parse.
     *
     * @return TVertexDescriptor The vertex descriptor of the state that was reached
     *                           after parsing.
     *
     * The parsing stops before @link WordGraph#getSuccessor @endlink reaches the
     * nil state or if the complete sequence is read.
     *
     * @fn WordGraph#canParseString
     *
     * @brief Test whether an WordGraph can parse a string completely.
     *
     * @signature bool canParseString(a[, v], str);
     *
     * @param[in] a The WordGraph to use for parsing.
     * @param[in] v Optionally, the descriptor of the vertex to start at. Defaults
     *              to the root.
     * @param[in] str The string to parse.
     *
     * @return bool <tt>true</tt> if the WordGraph parses <tt>str</tt> , starting at
     *              <tt>v</tt>, completely and <tt>false</tt> otherwise.
     *
     * @section Remarks
     *
     * This has not implemented yet.
     */