public List<CoreMap> getAPIElementSentences(boolean parse) { List<CoreMap> sentences = section.sentences; // getAllSentences(parse); List<CoreMap> apiSentences = new ArrayList<CoreMap>(); String formattedAPI = apiElement .getAPIElementName() .replaceAll("\\(", "") .replaceAll("\\)", "") .replaceAll("\\.", "-") .toLowerCase(); if (sentences == null) System.out.println("Warning"); for (CoreMap sent : sentences) { if (sent.toString().toLowerCase().indexOf("clt_" + formattedAPI) != -1) apiSentences.add(sent); } if (apiSentences.isEmpty()) System.out.println( "WARNGING: In getAPIElementSentences " + apiElement.getAPIElementName() + "," + section.getSubTitle()); return apiSentences; }
public String getProcessedSectionText() { String sectionText = Utils.HTML2Text( Utils.addPunctuationHTML( Utils.replaceCLTDelimiter(modifyAPIElementText(section.getHTML())))); return sectionText; }
public void saveToFile(String saveFilePath) { try { CSVWriter writer = new CSVWriter(new FileWriter(saveFilePath, true)); writer.writeNext( new String[] { section.getSubTitle(), apiElement.getAPIElementName(), Boolean.toString(label) }); writer.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public boolean hasCode() { return section.hasCode(); }
public boolean isInCode() { return section.isInCode(apiElement); }