Package com.gengoai.hermes
Class Fragments
- java.lang.Object
-
- com.gengoai.hermes.Fragments
-
public final class Fragments extends Object
Convenience methods for constructing orphaned and empty fragments.
- Author:
- David B. Bracewell
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HString
emptyHString(Document document)
Creates an empty HString associated with the given document.static Annotation
orphanedAnnotation(AnnotationType annotationType)
Creates an orphaned empty annotation, i.e.static HString
span(Document document, int start, int end)
Creates an HString which is a span, i.e.static HString
stringWrapper(@NonNull String content)
Creates a new HString that has content, but no document associated with it
-
-
-
Method Detail
-
emptyHString
public static HString emptyHString(Document document)
Creates an empty HString associated with the given document.- Parameters:
document
- the document the HString is span on- Returns:
- the new HString (associated with the given document if it is not null)
-
orphanedAnnotation
public static Annotation orphanedAnnotation(AnnotationType annotationType)
Creates an orphaned empty annotation, i.e. an empty span and no document associated with it.- Returns:
- the annotation
-
span
public static HString span(Document document, int start, int end)
Creates an HString which is a span, i.e. fragment, of text on the given document.- Parameters:
document
- the documentstart
- the startend
- the end- Returns:
- the h string
-
-