Upload
others
View
12
Download
0
Embed Size (px)
Citation preview
Name: Mohit M. Moradiya
CsuId: 2641323
13 | P a g e
Output Screenshot
Name: Mohit M. Moradiya
CsuId: 2641323
14 | P a g e
DataCount.java if we use Jsoup parser
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package dataanalysiscount;
import java.util.StringTokenizer;
import org.jsoup.Jsoup;
/**
*
* @author Mohit
*/
public class DataCount {
int countResearch(String line, String subString){
int countPerLine = 0;
line = Jsoup.parse(line).text();
int index = 0;
while ((index = line.indexOf(subString, index)) != -1)
{
index++;
countPerLine++;
}
return countPerLine;
}
}
Name: Mohit M. Moradiya
CsuId: 2641323
15 | P a g e
Output with Using Jsoup
Name: Mohit M. Moradiya
CsuId: 2641323
16 | P a g e
DataCout.java Class without type of parsing or ignoring html contents
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package dataanalysiscount;
import java.util.StringTokenizer;
import org.jsoup.Jsoup;
/**
*
* @author Mohit
*/
public class DataCount {
int countResearch(String line, String subString){
int countPerLine = 0;
int index = 0;
while ((index = line.indexOf(subString, index)) != -1)
{
index++;
countPerLine++;
}
return countPerLine;
}
}
Name: Mohit M. Moradiya
CsuId: 2641323
17 | P a g e
Output without any type of parsing or ignoring html contents