Data Formatting
General Info
Useful Snippets

9.0.24 Return Nth sentance in a string

Example:

def return_nth_sentance(text, n=0):
    '''
    Specify the position of the sentance you want to return and this function returns that sentance, such as n = 0.
    By Default, the the first (n=0) sentance is returned.
    '''
    sentance_token_list = sent_tokenize(text)  # Tokenize the string by converting each word to an item in a list
    sentance_n = sentance_token_list[n]
    return(sentance_n)