def lookupOrInfer( pd, pi, word ):
    """
    Lookup a word, take the first pronunciation. If not known,
    infer a pronunciation and return that.
    """
    pronunciations = pd.findPronunciations( word )
    if len( pronunciations ) <= 0:
        pronunciation = pi.pronounce( word )
    else:
        pronunciation = pronunciations[ 0 ]
    return pronunciation