@Override
  public List<String> tokenise(String text) {
    if (text == null || text.isEmpty()) {
      return new ArrayList<>();
    }

    text = text.replaceAll("[^\\p{L}\\p{N}\\s\\-'.]", " ").trim();
    String[] parts = text.split("\\s+");

    var tokenBuilder = new StringBuilder();

    List<String> tokenParts = Stream.of(parts)
        .flatMap(part -> {
          if (isPrefixWord(part) && !tokenBuilder.isEmpty()) {
            tokenBuilder.append(" ").append(part);
            return Stream.empty();
          } else {
            if (!tokenBuilder.isEmpty()) {
              String token = tokenBuilder.append(" ").append(part).toString();
              tokenBuilder.setLength(0);
              return Stream.of(token);
            } else if (isPrefixWord(part)) {
              tokenBuilder.append(part);
              return Stream.empty();
            } else {
              return Stream.of(part);
            }
          }
        })
        .collect(Collectors.toList());

    if (!tokenBuilder.isEmpty()) {
      tokenParts.add(tokenBuilder.toString());
    }

    return new ArrayList<>(tokenParts);
  }
@Description("Tokenise, when text only has one word, then return one word")
  @Test
  void tokenise_WhenTextOnlyHasOneWord_ThenReturnOneToken() {

    // When
    var result = textTokeniser.tokenise("Glasgow");

    // Then
    assertThat(result).isNotEmpty().hasSize(1).contains("Glasgow");
  }