Assume you have two files content.txt having the text to summarize and keyword.txt having the keyword
Use BufferedReader to read the keywords into memory array/ list
Use BufferedReader to read each line from content.txt into String.
For each keyword Use
matches method in the String class to check whether the keyword is present in the line
If present output the line and also increment a counter for the keyword
Continue with next line
At the end output how many times each keyword is found.
If you have strict performance in mind this will need some tuning.
Let me know if you need sample code
HTML Code:
<script type="text/javascript"><!--
google_ad_client = "pub-7374813015672333";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "336699";
google_color_bg = "FFFFCC";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
google_ui_features = "rc:10";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>