Пример #1
0
    def validateFromString(cls,xmlstring,target):
        """
        Fully validates the corpus against a specific format.

        @param xmlstring: XML containing the corpus
        @type xmlstring: string 
        @param target: target format
        @type target: string

        @return: validity of the corpus
        @rtype: boolean
        """
        corpus = Corpus()
        if corpus.readFromString(xmlstring):
            return( Validator.validate(corpus,target) )        
        else:
            return(False)
Пример #2
0
    def validateFromFile(cls,infile,target):
        """
        Fully validates the corpus against a specific format.

        @param infile: file containing the corpus
        @type infile: file name or open file
        @param target: target format
        @type target: string

        @return: validity of the corpus
        @rtype: boolean
        """
        corpus = Corpus()
        if corpus.readFromFile(infile):
            return( Validator.validate(corpus,target) )
        else:
            return(False)
Пример #3
0
    def validateFromET(cls,root,target):
        """
        Fully validates the corpus against a specific format.

        @param root: the root node of the corpus
        @type root: cElementTree.Element
        @param target: target format
        @type target: string

        @return: validity of the corpus
        @rtype: boolean
        """
        corpus = Corpus()
        if corpus.readFromET(root):
            return( Validator.validate(corpus,target) )
        else:
            return(False)