def __init__(self, doc, *args, **kwargs):
        """

        Example::

                phon = folia.PhonContent(doc, 'hɛˈləʊ̯')
                phon = folia.PhonContent(doc, 'hɛˈləʊ̯', cls="original")

        """

        if 'offset' in kwargs: #offset
            self.offset = int(kwargs['offset'])
            del kwargs['offset']
        else:
            self.offset = None



        #If no class is specified, it defaults to 'current'. (FoLiA uncharacteristically predefines two classes for phon: current and original)
        if 'cls' not in kwargs and 'class' not in kwargs:
            kwargs['cls'] = 'current'

        if 'ref' in kwargs: #reference to offset
            if isinstance(kwargs['ref'], AbstractElement):
                if kwargs['ref'].id is None:
                    raise ValueError("Reference for phonetic content must have an ID or can't act as reference!")
                self.ref = kwargs['ref'].id
            else:
                #a string (ID) is passed, we can't resolve it yet cause it may not exist at construction time, use getreference() to resolve when needed
                self.ref = kwargs['ref']
            del kwargs['ref']
        else:
            self.ref = None #no explicit reference; if the reference is implicit, getreference() will still work

        super(PhonContent,self).__init__(doc, *args, **kwargs)

        if not self.data:
            raise ValueError("Empty phonetic content elements are not allowed")
def __init__ ( self , doc , * args , ** kwargs ) : if 'offset' in kwargs : self . offset = int ( kwargs [ 'offset' ] ) del kwargs [ 'offset' ] else : self . offset = None if 'cls' not in kwargs and 'class' not in kwargs : kwargs [ 'cls' ] = 'current' if 'ref' in kwargs : if isinstance ( kwargs [ 'ref' ] , AbstractElement ) : if kwargs [ 'ref' ] . id is None : raise ValueError ( "Reference for phonetic content must have an ID or can't act as reference!" ) self . ref = kwargs [ 'ref' ] . id else : self . ref = kwargs [ 'ref' ] del kwargs [ 'ref' ] else : self . ref = None super ( PhonContent , self ) . __init__ ( doc , * args , ** kwargs ) if not self . data : raise ValueError ( "Empty phonetic content elements are not allowed" )
Example::

                phon = folia.PhonContent(doc, 'hɛˈləʊ̯')
                phon = folia.PhonContent(doc, 'hɛˈləʊ̯', cls="original")