There are many facets to working with strings in data. This includes comparing strings or finding specific
Question:
There are many facets to working with strings in data. This includes comparing strings or finding specific characters, words, or phrases. More advanced usage of textual data includes authorship analysis with the imposter algorithm or assessing sentiment in business reviews. Another example is the count of keywords in the search engine page ranking.
Problem One
Currently, I have no way to count the number of times a substring matches within another string. To solve this problem, I will need to create two functions: countSubstrMatches and countSubstrRecursive. Both of these functions will take two arguments: a string to search and the substring you want to find.
Ensure assumptions are not made regarding the string that is going to be searched. This string could be a word, phrase, novel, or nonsense. When working on the function that will search recursively, think about how to break this problem down into smaller pieces. Adding an optional argument to the function might be helpful. If wondering what optional argument would be useful here, consider how processed the string in the iterative function.
Analytics Data Science And Artificial Intelligence Systems For Decision Support
ISBN: 9781292341552
11th Global Edition
Authors: Ramesh Sharda, Dursun Delen, Efraim Turban