Converts a NAF object to KAF (in memory). You will have to use the method dump later to save it as a new KAF file

def to_kaf(self):
        """
        Converts a NAF object to KAF (in memory). You will have to use the method dump later to save it as a new KAF file
        """

        if self.type == 'NAF':
            self.root.tag = 'KAF'
            self.type = 'KAF'

        ## Convert the header
        if self.header is not None:
            self.header.to_kaf()

        ## Convert the token layer
        if self.text_layer is not None:
            self.text_layer.to_kaf()

        ## Convert the term layer
        if self.term_layer is not None:
            self.term_layer.to_kaf()


        ## Convert the chunk layer
        if self.chunk_layer is not None:
            self.chunk_layer.to_kaf()

        ## Convert the entity layer
        if self.entity_layer is not None:
            self.entity_layer.to_kaf()

        ## Convert the features layer
        ## There is no feature layer defined in NAF, but we assumed
        ## that is defined will be followin the same rules
        if self.features_layer is not None:
            self.features_layer.to_kaf()


        ##Convert the opinion layer
        if self.opinion_layer is not None:
            self.opinion_layer.to_kaf()

        ## Convert the constituency layer
        ## This layer is exactly the same in KAF/NAF
        if self.constituency_layer is not None:
            self.constituency_layer.to_kaf()    #Does nothing...


        ## Convert the dedepency layer
        ## It is not defined on KAF so we assme both will be similar
        if self.dependency_layer is not None:
            self.dependency_layer.to_kaf()

        if self.coreference_layer is not None:
            self.coreference_layer.to_kaf()


        ## Convert the temporalRelations layer
        ## It is not defined on KAF so we assme both will be similar
        if self.temporalRelations_layer is not None:
            self.temporalRelations_layer.to_kaf()

        ## Convert the causalRelations layer
        ## It is not defined on KAF so we assme both will be similar
        if self.causalRelations_layer is not None:
            self.causalRelations_layer.to_kaf()

        ## Convert the factualitylayer
        ## It is not defined on KAF so we assme both will be similar
        if self.factuality_layer is not None:
            self.factuality_layer.to_kaf()


        ## Convert the attribution_layer
        ## It is not defined on KAF so we assme both will be similar
        if self.attribution_layer is not None:
            self.attribution_layer.to_kaf()