def get_true_cased_text(obj: Union[Token, Span], lemmatize: bool = False):
    """Correct casing so that sentence-initial words are not title-cased. Named
    entities and other special cases (such as the word "I") should still be
    title-cased.

    obj (Token / Span): The spaCy object to conver to text.
    lemmatize (bool): Use the object's lemma instead of its text.
    RETURNS (unicode): The converted text.
    """
    if lemmatize:
        return obj.lemma_
    if isinstance(obj, Token) and (not obj.is_sent_start or obj.ent_type_):
        return obj.text
    elif isinstance(obj, Span) and (not obj[0].is_sent_start or obj[0].ent_type):
        return obj.text
    elif (  # Okay, we have a non-entity, starting a sentence
        not obj.text[0].isupper()  # Is its first letter upper-case?
        or any(c.isupper() for c in obj.text[1:])  # ..Only its first letter?
        or obj.text[0] == "I"  # Is it "I"?
    ):
        return obj.text
    else:  # Fix the casing
        return obj.text.lower()
Correct casing so that sentence-initial words are not title-cased. Named
    entities and other special cases (such as the word "I") should still be
    title-cased.

    obj (Token / Span): The spaCy object to conver to text.
    lemmatize (bool): Use the object's lemma instead of its text.
    RETURNS (unicode): The converted text.
    
sense2vec/util.py