So thats when this curious consultant started wondering


String Processing: Effective method to check string contains in Java

There are many applications (e.g. information retrieval, Natural Language processing) that require searching a large string for words, terms, or statements. The link below describe several methods to do that using C#.

In this assignment, you are expected to use a large input text file (of more than 3000 words). You will evaluate 3 different method, based on performance. All three methods should have the same signature

Public int NumberOfOccurrences (string inputfile, string word)

The output will be the number of time the word occur in the input file. Evaluate the three methods you selected based on performance. Test your code with 5 different test cases.

The Background:

How many of us C# programmers have had to check if a string is contained within another string? A simple match. We don't care how many times it may exist, we only want to know if it does.

There are numerous native C# methods for doing this: String.Contains(), String.IndexOf(), through Regex regular expressions, and similar options for those programmers obsessed with LINQ.

So that's when this curious consultant started wondering... what is the fastest way to test and see if a string is contained within another string?

Solution Preview :

Prepared by a verified Expert
JAVA Programming: So thats when this curious consultant started wondering
Reference No:- TGS01275306

Now Priced at $50 (50% Discount)

Recommended (94%)

Rated (4.6/5)