13 unique_ptr<Sequence> AbstractTransliterator::translate(
const SequenceInterface& sequence)
const
17 auto alphaPtr = getTargetAlphabet();
18 auto tSeq = make_unique<Sequence>(sequence.
getName(),
"", sequence.
getComments(), alphaPtr);
19 int gap = sequence.
getAlphabet()->getGapCharacterCode();
20 for (
size_t i = 0; i < sequence.
size(); ++i)
24 tSeq->addElement(gap);
26 tSeq->addElement(translate(state));
31 unique_ptr<Sequence> AbstractReverseTransliterator::reverse(
const SequenceInterface& sequence)
const
35 auto alphaPtr = getSourceAlphabet();
36 auto rSeq = make_unique<Sequence>(sequence.
getName(),
"", sequence.
getComments(), alphaPtr);
37 for (
size_t i = 0; i < sequence.
size(); ++i)
39 rSeq->addElement(reverse(sequence.
getValue(i)));
Exception thrown when two alphabets do not match.
virtual std::string getAlphabetType() const =0
Identification method.
virtual const std::string & getName() const =0
Get the name of this sequence.
virtual std::shared_ptr< const Alphabet > getAlphabet() const =0
Get the alphabet associated to the list.
virtual size_t size() const =0
Get the number of elements in the list.
virtual const Alphabet & alphabet() const =0
Get the alphabet associated to the list.
virtual const T & getValue(size_t pos) const =0
checked access to a character in list.
This alphabet is used to deal NumericAlphabet.