# -*- coding: iso-8859-1 -*- # Copyright 20003 - 2008: Julien Bourdaillet (julien.bourdaillet@lip6.fr), Jean-Gabriel Ganascia (jean-gabriel.ganascia@lip6.fr) # This file is part of MEDITE. # # MEDITE is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # MEDITE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Foobar; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #---------------------------------------------------------------------------- # Nom: resultatAppli.py # Objet: Classe qui regroupe les donnees d'une comparaison d'un couple # de etats ( utilisee par l'interface ) #---------------------------------------------------------------------------- import sys,logging,contract,Utile.decodage import numpy import planTravail import MediteAppli.utile contract.checkmod(__name__) class Resultat(object): """ Classe qui retourne le resulat obtenu apres comparaison de deux etats """ def __init__(self, pLI, pLS, pLD, pLR, pLgSource, pTextes, pBlocsCommuns, pairesBlocsDepl): self._li = pLI # liste des insertions self._ls = pLS # liste des suppression self._ld = pLD # liste des deplacements self._lr = pLR # liste des remplacements self._lgTexteS = pLgSource # longueur du texte source self._textes = pTextes # les deux etats concatenes self._blocsCom = pBlocsCommuns # blocs communs self._pairesBlocsDepl = pairesBlocsDepl #paires de blocs déplacés def getListeInsertions(self): return self._li def getListeSuppressions(self): return self._ls def getListeDeplacements(self): return self._ld def _filtre(self,liste,deb,fin): """ Renvoie la sous-liste des items de liste compris entre deb et fin pre: 0<=deb