test_class.declarator: log = LoggerFactory.getLogger(ReadabilityServiceImplTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger log = LoggerFactory.getLogger(ReadabilityServiceImplTest.class);
test_class.type: Logger
test_class.var_name: log
test_class.declarator: readabilityService
test_class.modifier: private
test_class.original_string: private ReadabilityServiceImpl readabilityService;
test_class.type: ReadabilityServiceImpl
test_class.var_name: readabilityService
test_class.declarator: source1
test_class.modifier: private
test_class.original_string: private String source1;
test_class.type: String
test_class.var_name: source1
test_class.declarator: source2
test_class.modifier: private
test_class.original_string: private String source2;
test_class.type: String
test_class.var_name: source2
test_class.declarator: source3
test_class.modifier: private
test_class.original_string: private String source3;
test_class.type: String
test_class.var_name: source3
test_class.file: core/src/test/java/org/apache/sling/cms/core/readability/impl/ReadabilityServiceImplTest.java
test_class.identifier: ReadabilityServiceImplTest
test_case.body: @Test
      public void testExtractSentences() throws IOException {
          log.info("testExtractSentences");
  
          Text text = readabilityService.extractSentences(source1);
  
          logAll(text);
  
          assertNotNull(text);
          assertEquals(3, text.getSentences().size());
          assertEquals(86, text.getWordCount());
          assertEquals(11, text.getComplexWordCount());
  
          text = readabilityService.extractSentences(source2);
  
          logAll(text);
  
          assertNotNull(text);
          assertEquals(12, text.getSentences().size());
          assertEquals(195, text.getWordCount());
          assertEquals(50, text.getComplexWordCount());
  
          text = readabilityService.extractSentences(source3);
  
          logAll(text);
  
          assertNotNull(text);
          assertEquals(11, text.getSentences().size());
          assertEquals(157, text.getWordCount());
          assertEquals(7, text.getComplexWordCount());
  
          log.info("Tests successful!");
      }
test_case.class_method_signature: ReadabilityServiceImplTest.testExtractSentences()
test_case.full_signature: @Test public void testExtractSentences()
test_case.identifier: testExtractSentences
test_case.invocations: info extractSentences logAll assertNotNull assertEquals size getSentences assertEquals getWordCount assertEquals getComplexWordCount extractSentences logAll assertNotNull assertEquals size getSentences assertEquals getWordCount assertEquals getComplexWordCount extractSentences logAll assertNotNull assertEquals size getSentences assertEquals getWordCount assertEquals getComplexWordCount info
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExtractSentences()
focal_class.declarator: complexityMin
focal_class.modifier: private
focal_class.original_string: private int complexityMin;
focal_class.type: int
focal_class.var_name: complexityMin
focal_class.declarator: extraVowelExpression
focal_class.modifier: private
focal_class.original_string: private Pattern extraVowelExpression;
focal_class.type: Pattern
focal_class.var_name: extraVowelExpression
focal_class.declarator: isWordExpression
focal_class.modifier: private
focal_class.original_string: private Pattern isWordExpression;
focal_class.type: Pattern
focal_class.var_name: isWordExpression
focal_class.declarator: locale
focal_class.modifier: private
focal_class.original_string: private Locale locale;
focal_class.type: Locale
focal_class.var_name: locale
focal_class.declarator: vowelExpression
focal_class.modifier: private
focal_class.original_string: private Pattern vowelExpression;
focal_class.type: Pattern
focal_class.var_name: vowelExpression
focal_class.declarator: wordstems
focal_class.modifier: private
focal_class.original_string: private List<String> wordstems;
focal_class.type: List<String>
focal_class.var_name: wordstems
focal_class.file: core/src/main/java/org/apache/sling/cms/core/readability/impl/ReadabilityServiceImpl.java
focal_class.identifier: ReadabilityServiceImpl
focal_class.interfaces: implements ReadabilityService
focal_class.class_method_signature: ReadabilityServiceImpl.activate(ReadabilityConfig config)
focal_class.full_signature: @Activate public void activate(ReadabilityConfig config)
focal_class.identifier: activate
focal_class.modifiers: @Activate public
focal_class.parameters: (ReadabilityConfig config)
focal_class.return: void
focal_class.signature: void activate(ReadabilityConfig config)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateARI(String text)
focal_class.full_signature: @Override public double calculateARI(String text)
focal_class.identifier: calculateARI
focal_class.modifiers: @Override public
focal_class.parameters: (String text)
focal_class.return: double
focal_class.signature: double calculateARI(String text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateARI(Text text)
focal_class.full_signature: @Override public double calculateARI(Text text)
focal_class.identifier: calculateARI
focal_class.modifiers: @Override public
focal_class.parameters: (Text text)
focal_class.return: double
focal_class.signature: double calculateARI(Text text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateAverageGradeLevel(String text)
focal_class.full_signature: @Override public double calculateAverageGradeLevel(String text)
focal_class.identifier: calculateAverageGradeLevel
focal_class.modifiers: @Override public
focal_class.parameters: (String text)
focal_class.return: double
focal_class.signature: double calculateAverageGradeLevel(String text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateAverageGradeLevel(Text text)
focal_class.full_signature: @Override public double calculateAverageGradeLevel(Text text)
focal_class.identifier: calculateAverageGradeLevel
focal_class.modifiers: @Override public
focal_class.parameters: (Text text)
focal_class.return: double
focal_class.signature: double calculateAverageGradeLevel(Text text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateColemanLiauIndex(String text)
focal_class.full_signature: @Override public double calculateColemanLiauIndex(String text)
focal_class.identifier: calculateColemanLiauIndex
focal_class.modifiers: @Override public
focal_class.parameters: (String text)
focal_class.return: double
focal_class.signature: double calculateColemanLiauIndex(String text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateColemanLiauIndex(Text text)
focal_class.full_signature: @Override public double calculateColemanLiauIndex(Text text)
focal_class.identifier: calculateColemanLiauIndex
focal_class.modifiers: @Override public
focal_class.parameters: (Text text)
focal_class.return: double
focal_class.signature: double calculateColemanLiauIndex(Text text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateFleschKincaidGradeLevel(String text)
focal_class.full_signature: @Override public double calculateFleschKincaidGradeLevel(String text)
focal_class.identifier: calculateFleschKincaidGradeLevel
focal_class.modifiers: @Override public
focal_class.parameters: (String text)
focal_class.return: double
focal_class.signature: double calculateFleschKincaidGradeLevel(String text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateFleschKincaidGradeLevel(Text text)
focal_class.full_signature: @Override public double calculateFleschKincaidGradeLevel(Text text)
focal_class.identifier: calculateFleschKincaidGradeLevel
focal_class.modifiers: @Override public
focal_class.parameters: (Text text)
focal_class.return: double
focal_class.signature: double calculateFleschKincaidGradeLevel(Text text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateFleschReadingEase(String text)
focal_class.full_signature: @Override public double calculateFleschReadingEase(String text)
focal_class.identifier: calculateFleschReadingEase
focal_class.modifiers: @Override public
focal_class.parameters: (String text)
focal_class.return: double
focal_class.signature: double calculateFleschReadingEase(String text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateFleschReadingEase(Text text)
focal_class.full_signature: @Override public double calculateFleschReadingEase(Text text)
focal_class.identifier: calculateFleschReadingEase
focal_class.modifiers: @Override public
focal_class.parameters: (Text text)
focal_class.return: double
focal_class.signature: double calculateFleschReadingEase(Text text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateGunningFog(String text)
focal_class.full_signature: @Override public double calculateGunningFog(String text)
focal_class.identifier: calculateGunningFog
focal_class.modifiers: @Override public
focal_class.parameters: (String text)
focal_class.return: double
focal_class.signature: double calculateGunningFog(String text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateGunningFog(Text text)
focal_class.full_signature: @Override public double calculateGunningFog(Text text)
focal_class.identifier: calculateGunningFog
focal_class.modifiers: @Override public
focal_class.parameters: (Text text)
focal_class.return: double
focal_class.signature: double calculateGunningFog(Text text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateSMOG(String text)
focal_class.full_signature: @Override public double calculateSMOG(String text)
focal_class.identifier: calculateSMOG
focal_class.modifiers: @Override public
focal_class.parameters: (String text)
focal_class.return: double
focal_class.signature: double calculateSMOG(String text)
focal_class.class_method_signature: ReadabilityServiceImpl.calculateSMOG(Text text)
focal_class.full_signature: @Override public double calculateSMOG(Text text)
focal_class.identifier: calculateSMOG
focal_class.modifiers: @Override public
focal_class.parameters: (Text text)
focal_class.return: double
focal_class.signature: double calculateSMOG(Text text)
focal_class.class_method_signature: ReadabilityServiceImpl.countSylables(String word)
focal_class.full_signature: private int countSylables(String word)
focal_class.identifier: countSylables
focal_class.modifiers: private
focal_class.parameters: (String word)
focal_class.return: int
focal_class.signature: int countSylables(String word)
focal_class.class_method_signature: ReadabilityServiceImpl.deduplicateVowels(String word)
focal_class.full_signature: private String deduplicateVowels(String word)
focal_class.identifier: deduplicateVowels
focal_class.modifiers: private
focal_class.parameters: (String word)
focal_class.return: String
focal_class.signature: String deduplicateVowels(String word)
focal_class.class_method_signature: ReadabilityServiceImpl.extractSentences(String input)
focal_class.full_signature: @Override public Text extractSentences(String input)
focal_class.identifier: extractSentences
focal_class.modifiers: @Override public
focal_class.parameters: (String input)
focal_class.return: Text
focal_class.signature: Text extractSentences(String input)
focal_class.class_method_signature: ReadabilityServiceImpl.extractWords(String sentence)
focal_class.full_signature: private List<Word> extractWords(String sentence)
focal_class.identifier: extractWords
focal_class.modifiers: private
focal_class.parameters: (String sentence)
focal_class.return: List<Word>
focal_class.signature: List<Word> extractWords(String sentence)
focal_class.class_method_signature: ReadabilityServiceImpl.getLocale()
focal_class.full_signature: @Override public Locale getLocale()
focal_class.identifier: getLocale
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Locale
focal_class.signature: Locale getLocale()
focal_class.class_method_signature: ReadabilityServiceImpl.isVowel(char ch)
focal_class.full_signature: private boolean isVowel(char ch)
focal_class.identifier: isVowel
focal_class.modifiers: private
focal_class.parameters: (char ch)
focal_class.return: boolean
focal_class.signature: boolean isVowel(char ch)
focal_class.class_method_signature: ReadabilityServiceImpl.stripWordStem(String wordStr)
focal_class.full_signature: private String stripWordStem(String wordStr)
focal_class.identifier: stripWordStem
focal_class.modifiers: private
focal_class.parameters: (String wordStr)
focal_class.return: String
focal_class.signature: String stripWordStem(String wordStr)
focal_method.body: @Override
      public Text extractSentences(String input) {
          BreakIterator breakIterator = BreakIterator.getSentenceInstance(locale);
          breakIterator.setText(input);
          int start = breakIterator.first();
          List<String> sentenceStrs = new ArrayList<>();
          for (int end = breakIterator.next(); end != BreakIterator.DONE; start = end, end = breakIterator.next()) {
              sentenceStrs.add(input.substring(start, end));
          }
          return new Text(input,
                  sentenceStrs.stream().map(s -> new Sentence(s, extractWords(s))).collect(Collectors.toList()));
      }
focal_method.class_method_signature: ReadabilityServiceImpl.extractSentences(String input)
focal_method.full_signature: @Override public Text extractSentences(String input)
focal_method.identifier: extractSentences
focal_method.invocations: getSentenceInstance setText first next next add substring collect map stream extractWords toList
focal_method.modifiers: @Override public
focal_method.parameters: (String input)
focal_method.return: Text
focal_method.signature: Text extractSentences(String input)