Please ZIP up your solutions and email back. Or use your own github account. Please: Do not commit them here.
Please provide a solution in Java that meets the requirements of problems described below. Java 1.7 is preferred for now. Though if you wish to use Java 1.8, and use 1.8 features, please provide at least one solution that does not require 1.8 features. Document any assumptions you are making about inputs and outputs clearly.
Make the best programming choices as you would normally do for this assignment. The types of skills you'll be evaluated on are your proficiency with the Java language, programming and design skills, pursuit of best practices, accuracy of solution, and code testability. Tests that prove your solutions work are a necessary deliverable given we want proof the solution works.
Once you are ready with the solution, please zip the source set and share it via email. A short summary of your approach is welcome documentation. Good luck!
- Given: A textual payload for input processing and a library of keywords
- When: A keyword is encountered in the textual payload as a word
- Then: The keyword should be highlighted by place a "<" before the keyword and a ">" after the keyword
E.g.
-
Keyword: "Red"
-
Input: "A Red Sky"
-
Output: "A <Red> Sky"
-
Input: "I come from Redmond California"
-
Output: "I come from Redmond California"
Use this README as your input text. We have provided a Text version in this repo (TextProcessing.txt)
Use this list as your keywords: java, snippet, solution
A snippet of text is an arbitray length of text pulled out from a larger body of text. A piece of text. An extract of text.
We want you to find keywords in a body of text and extract the snippets of text that surrounds them. We would like the keywords highlighted as well just like problem number one above.
We are defining a snippet of text as up to 20 characters preceding the keyword, the keyword itself, and up to 20 characters following the keyword. Our problem then is:
- Given: A textual payload for input processing and a library of keywords
- When: A keyword is encountered in the textual payload as a word
- Then: A snippet of text (as decribed above) surrounding the keyword is extracted and the keyword highlighted
Example:
- Keyword: refers
- Input Text: "This is some sample text that I am typing. Typing refers back to the days of typewriters."
- Output Snippet: "I am typing. Typing <refers> back to the days of"
Use this README as your input text. We have provided a Text version in this repo (TextProcessing.txt)
Use this list as your keywords: java, snippet, solution
Please ZIP up your solutions and email back. Or use your own github account. Please: Do not commit them here.