test_class.file: backend/project-board/src/test/java/de/adesso/projectboard/base/search/HibernateSimpleQueryUtilsTest.java
test_class.identifier: HibernateSimpleQueryUtilsTest
test_case.body: @Test
      public void makeQueryPrefixAndFuzzyDoesNotReplacePhraseTerms() {
          // given
          var expectedSimpleQuery = "\"java\"";
  
          // when
          var actualQuery = HibernateSimpleQueryUtils.makeQueryPrefixAndFuzzy(expectedSimpleQuery);
  
          // then
          assertThat(actualQuery).isEqualTo(expectedSimpleQuery);
      }
test_case.class_method_signature: HibernateSimpleQueryUtilsTest.makeQueryPrefixAndFuzzyDoesNotReplacePhraseTerms()
test_case.full_signature: @Test public void makeQueryPrefixAndFuzzyDoesNotReplacePhraseTerms()
test_case.identifier: makeQueryPrefixAndFuzzyDoesNotReplacePhraseTerms
test_case.invocations: makeQueryPrefixAndFuzzy isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void makeQueryPrefixAndFuzzyDoesNotReplacePhraseTerms()
focal_class.declarator: TERM_DELIMITER = Set.of('(', ')', '|', ' ', '&', '-')
focal_class.modifier: private static final
focal_class.original_string: private static final Set<Character> TERM_DELIMITER = Set.of('(', ')', '|', ' ', '&', '-');
focal_class.type: Set<Character>
focal_class.var_name: TERM_DELIMITER
focal_class.declarator: SPECIAL_CHARACTERS = Set.of('~', '*')
focal_class.modifier: private static final
focal_class.original_string: private static final Set<Character> SPECIAL_CHARACTERS = Set.of('~', '*');
focal_class.type: Set<Character>
focal_class.var_name: SPECIAL_CHARACTERS
focal_class.file: backend/project-board/src/main/java/de/adesso/projectboard/base/search/HibernateSimpleQueryUtils.java
focal_class.identifier: HibernateSimpleQueryUtils
focal_class.class_method_signature: HibernateSimpleQueryUtils.makeQueryPrefixAndFuzzy(@NonNull String simpleQuery)
focal_class.full_signature: public static String makeQueryPrefixAndFuzzy(@NonNull String simpleQuery)
focal_class.identifier: makeQueryPrefixAndFuzzy
focal_class.modifiers: public static
focal_class.parameters: (@NonNull String simpleQuery)
focal_class.return: String
focal_class.signature: String makeQueryPrefixAndFuzzy(@NonNull String simpleQuery)
focal_class.class_method_signature: HibernateSimpleQueryUtils.replaceTermWithFuzzyAndPrefixDisjunction(Pair<Integer, Integer> startEndIndexPair, String simpleQuery)
focal_class.full_signature: static String replaceTermWithFuzzyAndPrefixDisjunction(Pair<Integer, Integer> startEndIndexPair, String simpleQuery)
focal_class.identifier: replaceTermWithFuzzyAndPrefixDisjunction
focal_class.modifiers: static
focal_class.parameters: (Pair<Integer, Integer> startEndIndexPair, String simpleQuery)
focal_class.return: String
focal_class.signature: String replaceTermWithFuzzyAndPrefixDisjunction(Pair<Integer, Integer> startEndIndexPair, String simpleQuery)
focal_class.class_method_signature: HibernateSimpleQueryUtils.replaceSubstring(Pair<Integer, Integer> startEndIndexPair, String stringToReplaceIn, String replacement)
focal_class.full_signature: static String replaceSubstring(Pair<Integer, Integer> startEndIndexPair, String stringToReplaceIn, String replacement)
focal_class.identifier: replaceSubstring
focal_class.modifiers: static
focal_class.parameters: (Pair<Integer, Integer> startEndIndexPair, String stringToReplaceIn, String replacement)
focal_class.return: String
focal_class.signature: String replaceSubstring(Pair<Integer, Integer> startEndIndexPair, String stringToReplaceIn, String replacement)
focal_class.class_method_signature: HibernateSimpleQueryUtils.getIndexAfterFirstAppearanceOfAny(int startIndex, Set<Character> characters, String searchedString)
focal_class.full_signature: static int getIndexAfterFirstAppearanceOfAny(int startIndex, Set<Character> characters, String searchedString)
focal_class.identifier: getIndexAfterFirstAppearanceOfAny
focal_class.modifiers: static
focal_class.parameters: (int startIndex, Set<Character> characters, String searchedString)
focal_class.return: int
focal_class.signature: int getIndexAfterFirstAppearanceOfAny(int startIndex, Set<Character> characters, String searchedString)
focal_class.class_method_signature: HibernateSimpleQueryUtils.getIndexAfterFirstAppearanceOf(int startIndex, char character, String searchedString)
focal_class.full_signature: static int getIndexAfterFirstAppearanceOf(int startIndex, char character, String searchedString)
focal_class.identifier: getIndexAfterFirstAppearanceOf
focal_class.modifiers: static
focal_class.parameters: (int startIndex, char character, String searchedString)
focal_class.return: int
focal_class.signature: int getIndexAfterFirstAppearanceOf(int startIndex, char character, String searchedString)
focal_class.class_method_signature: HibernateSimpleQueryUtils.getIndexOfFirstAppearanceOfAny(int startIndex, Set<Character> characters, String searchedString)
focal_class.full_signature: static int getIndexOfFirstAppearanceOfAny(int startIndex, Set<Character> characters, String searchedString)
focal_class.identifier: getIndexOfFirstAppearanceOfAny
focal_class.modifiers: static
focal_class.parameters: (int startIndex, Set<Character> characters, String searchedString)
focal_class.return: int
focal_class.signature: int getIndexOfFirstAppearanceOfAny(int startIndex, Set<Character> characters, String searchedString)
focal_class.class_method_signature: HibernateSimpleQueryUtils.getIndexAfterPhraseTerm(int startIndex, String simpleQuery)
focal_class.full_signature: static int getIndexAfterPhraseTerm(int startIndex, String simpleQuery)
focal_class.identifier: getIndexAfterPhraseTerm
focal_class.modifiers: static
focal_class.parameters: (int startIndex, String simpleQuery)
focal_class.return: int
focal_class.signature: int getIndexAfterPhraseTerm(int startIndex, String simpleQuery)
focal_class.class_method_signature: HibernateSimpleQueryUtils.getReplaceableTermsOfQuery(String simpleQuery)
focal_class.full_signature: static List<Pair<Integer, Integer>> getReplaceableTermsOfQuery(String simpleQuery)
focal_class.identifier: getReplaceableTermsOfQuery
focal_class.modifiers: static
focal_class.parameters: (String simpleQuery)
focal_class.return: List<Pair<Integer, Integer>>
focal_class.signature: List<Pair<Integer, Integer>> getReplaceableTermsOfQuery(String simpleQuery)
focal_class.class_method_signature: HibernateSimpleQueryUtils.createLuceneQueryString(Collection<String> values, String operator,
                                                    Function<String, String> function)
focal_class.full_signature: public static String createLuceneQueryString(Collection<String> values, String operator,
                                                    Function<String, String> function)
focal_class.identifier: createLuceneQueryString
focal_class.modifiers: public static
focal_class.parameters: (Collection<String> values, String operator,
                                                    Function<String, String> function)
focal_class.return: String
focal_class.signature: String createLuceneQueryString(Collection<String> values, String operator,
                                                    Function<String, String> function)
focal_class.class_method_signature: HibernateSimpleQueryUtils.createLuceneQueryString(Collection<String> values, String operator)
focal_class.full_signature: public static String createLuceneQueryString(Collection<String> values, String operator)
focal_class.identifier: createLuceneQueryString
focal_class.modifiers: public static
focal_class.parameters: (Collection<String> values, String operator)
focal_class.return: String
focal_class.signature: String createLuceneQueryString(Collection<String> values, String operator)
focal_method.body: public static String makeQueryPrefixAndFuzzy(@NonNull String simpleQuery) {
          var trimmedSimpleQuery = simpleQuery.trim();
          var replaceableTermIndexPairs = getReplaceableTermsOfQuery(trimmedSimpleQuery);
  
          if(replaceableTermIndexPairs.isEmpty()) {
              return trimmedSimpleQuery;
          }
  
          var fuzzyAndPrefixQuery = trimmedSimpleQuery;
          var addedOffsetByReplacingTerms = 0;
  
          for(var pair : replaceableTermIndexPairs) {
              var termStartIndex = pair.getFirst() + addedOffsetByReplacingTerms;
              var termEndIndex = pair.getSecond() + addedOffsetByReplacingTerms;
              var termStartEndIndexPair = Pair.of(termStartIndex, termEndIndex);
  
              var preReplacementQueryLength = fuzzyAndPrefixQuery.length();
              fuzzyAndPrefixQuery = replaceTermWithFuzzyAndPrefixDisjunction(termStartEndIndexPair, fuzzyAndPrefixQuery);
              var postReplacementQueryLength = fuzzyAndPrefixQuery.length();
  
              addedOffsetByReplacingTerms += postReplacementQueryLength - preReplacementQueryLength;
          }
  
          return fuzzyAndPrefixQuery;
      }
focal_method.class_method_signature: HibernateSimpleQueryUtils.makeQueryPrefixAndFuzzy(@NonNull String simpleQuery)
focal_method.full_signature: public static String makeQueryPrefixAndFuzzy(@NonNull String simpleQuery)
focal_method.identifier: makeQueryPrefixAndFuzzy
focal_method.invocations: trim getReplaceableTermsOfQuery isEmpty getFirst getSecond of length replaceTermWithFuzzyAndPrefixDisjunction length
focal_method.modifiers: public static
focal_method.parameters: (@NonNull String simpleQuery)
focal_method.return: String
focal_method.signature: String makeQueryPrefixAndFuzzy(@NonNull String simpleQuery)