TextSplitterUtils

gitinsp.infrastructure.parser.TextSplitterUtils

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def splitTextWithRegex(text: String, separator: String, keepSeparator: Either[Boolean, String]): List[String]

Splits text using a regex separator, with options to keep the separator.

Splits text using a regex separator, with options to keep the separator.

  • keepSeparator = Left(false): Discards the separator.
  • keepSeparator = Left(true) | Right("start"): Keeps the separator at the beginning of the chunk that follows it.
  • keepSeparator = Right("end"): Keeps the separator at the end of the chunk that precedes it.
  • If separator is empty, splits into individual characters.

Attributes