Skip to content

Commit

Permalink
MidTerm file modified <bug fix>
Browse files Browse the repository at this point in the history
  • Loading branch information
sangriel committed Apr 21, 2022
1 parent b5167cc commit 15dd19d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions OpenSw/src/scripts/MidTerm.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class MidTerm {

private String input_file;
private String question;
private ArrayList<String> questionExtracted = new ArrayList<String>();



private File[] makeFileList(String path) {
Expand All @@ -56,6 +58,11 @@ private File[] makeFileList(String path) {
public MidTerm(String path,String question) {
this.input_file = path;
this.question = question;
questionExtracted = extractor(question);

System.out.println("size" + questionExtracted.size());
for ( int i = 0 ; i < questionExtracted.size(); i++) {
}
showSnippet();

}
Expand All @@ -72,7 +79,7 @@ private ArrayList<String> extractor(String body) {

for (int j = 0; j < kl.size(); j++) {
Keyword kwrd = kl.get(j);
result.add(kwrd + "");
result.add(kwrd.getString());
}


Expand Down Expand Up @@ -127,8 +134,10 @@ private void showSnippet() {
ArrayList<String> extracted = this.extractor(parsed);
int matchpoint = 0;
for (int j = 0 ; j < extracted.size(); j ++) {
if (extracted.get(j).contains(this.question)) {
matchpoint += 1;
for (int q = 0 ; q < questionExtracted.size();q++) {
if (extracted.get(j).contains(this.questionExtracted.get(q))) {
matchpoint += 1;
}
}
}

Expand Down

0 comments on commit 15dd19d

Please sign in to comment.