/** * Returns the sentence as a string, based on the original text and spacing * prior to tokenization. * This method assumes that this extra information has been encoded in CoreLabel * objects for each token of the sentence, which do have the original spacing * preserved (done with "invertible=true" for PTBTokenizer). * However, the method has loose typing for easier inter-operation * with old code that still works with a {@code List<HasWord>}. * * @param list The sentence (List of tokens) to print out * @return The original sentence String, which may contain newlines or other artifacts of spacing */ public static <T extends HasWord> String listToOriginalTextString(List<T> list) { return listToOriginalTextString(list, true); }
/** * Returns the sentence as a string, based on the original text and spacing * prior to tokenization. * This method assumes that this extra information has been encoded in CoreLabel * objects for each token of the sentence, which do have the original spacing * preserved (done with "invertible=true" for PTBTokenizer). * However, the method has loose typing for easier inter-operation * with old code that still works with a {@code List<HasWord>}. * * @param list The sentence (List of tokens) to print out * @return The original sentence String, which may contain newlines or other artifacts of spacing */ public static <T extends HasWord> String listToOriginalTextString(List<T> list) { return listToOriginalTextString(list, true); }
/** * Returns the sentence as a string, based on the original text and spacing * prior to tokenization. * This method assumes that this extra information has been encoded in CoreLabel * objects for each token of the sentence, which do have the original spacing * preserved (done with "invertible=true" for PTBTokenizer). * However, the method has loose typing for easier inter-operation * with old code that still works with a {@code List<HasWord>}. * * @param list The sentence (List of tokens) to print out * @return The original sentence String, which may contain newlines or other artifacts of spacing */ public static <T extends HasWord> String listToOriginalTextString(List<T> list) { return listToOriginalTextString(list, true); }