LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Lima::ShiftFrom Class Reference

#include <common/Handler/shiftFrom.h>

Inheritance diagram for Lima::ShiftFrom:

Public Member Functions

 ShiftFrom (const QString &xml)
 
virtual ~ShiftFrom ()
 
const QString & xml ()
 
const QString & xml_noent ()
 
int correct_offset (int offset, int indexOfToken) const
 Return the correct absolute position of a token in its origin text when found at position indexOfToken in a shifted text, taking into account shiftings in shiftFrom and the initial offset.
 
QString rebuild_text (const QString &input, int offset) const
 Replace in input the sequences in mapping (shifted by offset)
 

Friends

LIMA_DATAHANDLER_EXPORT QDebug & operator<< (QDebug &, const ShiftFrom &)
 

Detailed Description

Definition at line 24 of file shiftFrom.h.

Constructor & Destructor Documentation

◆ ShiftFrom()

Lima::ShiftFrom::ShiftFrom ( const QString &  xml)

Definition at line 93 of file shiftFrom.cpp.

◆ ~ShiftFrom()

Lima::ShiftFrom::~ShiftFrom ( )
virtual

Definition at line 100 of file shiftFrom.cpp.

Member Function Documentation

◆ correct_offset()

int Lima::ShiftFrom::correct_offset ( int  offset,
int  indexOfToken 
) const

Return the correct absolute position of a token in its origin text when found at position indexOfToken in a shifted text, taking into account shiftings in shiftFrom and the initial offset.

Definition at line 74 of file shiftFrom.cpp.

◆ rebuild_text()

QString Lima::ShiftFrom::rebuild_text ( const QString &  input,
int  offset 
) const

Replace in input the sequences in mapping (shifted by offset)

This allows to put back interpreted entities that were replaced by underscores to avoid introducing shifts in the input xml

Definition at line 54 of file shiftFrom.cpp.

◆ xml()

const QString & Lima::ShiftFrom::xml ( )

Definition at line 38 of file shiftFrom.cpp.

◆ xml_noent()

const QString & Lima::ShiftFrom::xml_noent ( )

Definition at line 43 of file shiftFrom.cpp.

Friends And Related Symbol Documentation

◆ operator<<

LIMA_DATAHANDLER_EXPORT QDebug & operator<< ( QDebug &  ,
const ShiftFrom &   
)
friend

Definition at line 160 of file shiftFrom.cpp.


The documentation for this class was generated from the following files: