{"id":19392163,"url":"https://github.com/hlibpavlyk/text-analyzer","last_synced_at":"2025-07-15T07:38:02.625Z","repository":{"id":259926577,"uuid":"879819234","full_name":"HlibPavlyk/text-analyzer","owner":"HlibPavlyk","description":"Java project using StringBuffer to count sentences containing each word from a user-provided list","archived":false,"fork":false,"pushed_at":"2024-11-04T15:58:46.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T22:09:58.827Z","etag":null,"topics":["java","string-buffer","text-analysis","word-counter"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HlibPavlyk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-28T15:47:38.000Z","updated_at":"2024-11-06T10:15:23.000Z","dependencies_parsed_at":"2024-10-28T18:21:38.583Z","dependency_job_id":"08905dc9-2f35-4120-a9e1-9cf25f03eb31","html_url":"https://github.com/HlibPavlyk/text-analyzer","commit_stats":null,"previous_names":["hlibpavlyk/text-analyzer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HlibPavlyk/text-analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HlibPavlyk%2Ftext-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HlibPavlyk%2Ftext-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HlibPavlyk%2Ftext-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HlibPavlyk%2Ftext-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HlibPavlyk","download_url":"https://codeload.github.com/HlibPavlyk/text-analyzer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HlibPavlyk%2Ftext-analyzer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265418487,"owners_count":23761817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","string-buffer","text-analysis","word-counter"],"created_at":"2024-11-10T10:30:56.060Z","updated_at":"2025-07-15T07:38:02.606Z","avatar_url":"https://github.com/HlibPavlyk.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Text Analyzer (Lab 2 Java Software Development)\n\nThis project performs text analysis using `StringBuffer` in Java. It counts how many sentences in a given text contain each word from a provided array of words. The program reads the text and words from user input, processes the text, and outputs the results.\n\n\n\n## Assignment\n\nDetermine **C3** as the remainder of dividing the student's record book number 13879064 by 3, and **C17** as the remainder of dividing the student's record book number 13879064 by 17.\n\nBased on **C3**, determine the type of text variables:\n\n| C3  | Type          |\n|-----|---------------|\n| 2   | StringBuffer  |\n\nBased on **C17**, determine the text operation:\n\n| C17 | Operation                                                                                     |\n|-----|-----------------------------------------------------------------------------------------------|\n| 9   | Given a text and an array of words, count in how many sentences each word from the array appears. |\n\n**Variant:**\n\n- **C3 = 2**: Use `StringBuffer` for text variables.\n- **C17 = 9**: Given a text and an array of words, count how many sentences contain each word from the array.\n\n\n## Features\n\n- **Text Input**: Users can input any text they wish to analyze.\n- **Word List Input**: Users can specify a list of words to search for within the text.\n- **Sentence Parsing**: The text is split into sentences based on punctuation marks (., !, ?).\n- **Word Counting**: Counts the number of sentences in which each word appears.\n- **Exception Handling**: Robust error handling for invalid inputs and null values.\n- **Uses StringBuffer**: All string manipulations are performed using `StringBuffer`, as per the assignment requirements.\n- **Code Standards**: Adheres to Java Code Conventions (or Google Java Style Guide).\n\n## Requirements\n\n- **Java Development Kit (JDK) 8** or higher installed on your system.\n- **Git** (optional, for cloning the repository).\n  \n## How to Run\n\n### Clone the Repository (Optional)\n\nIf the project is hosted on GitHub, clone it using:\n\n```bash\ngit clone https://github.com/HlibPavlyk/text-analyzer.git\ncd text-analyzer/src\n```\n\nAlternatively, you can download the source code files directly.\n\n### Compile the Source Code\n\nOpen a terminal or command prompt in the project directory and compile the Java files:\n\n```bash\njavac Main.java TextUtils.java\n```\n\n### Run the Program\n\nAfter successful compilation, run the program using:\n\n```bash\njava Main\n```\n\n## Usage Instructions\n\n1. **Starting the Program**:\n   - Run `java Main` in your terminal.\n\n2. **Input Text**:\n   - The program will prompt: `Enter the text:`\n   - Input the text you want to analyze. This can be multiple sentences ending with periods, exclamation marks, or question marks.\n\n3. **Input Word List**:\n   - The program will prompt: `Enter the number of words to search:`\n   - Input an integer representing how many words you want to search for.\n   - For each word, you will be prompted: `Enter word X:`\n     - Input each word you want to search for in the text.\n\n4. **Results Display**:\n   - After processing, the program will display how many sentences contain each word:\n     ```\n     Word 'example' occurs in 2 sentences.\n     Word 'test' occurs in 1 sentences.\n     ```\n\n## Example Session\n\n```\nEnter the text:\nThis is a test. Testing is essential! Is this example sufficient? Yes, this example should suffice.\n\nEnter the number of words to search:\n2\nEnter word 1:\ntest\nEnter word 2:\nexample\nWord 'test' occurs in 1 sentences.\nWord 'example' occurs in 2 sentences.\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\nFeel free to reach out for any questions or suggestions regarding this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlibpavlyk%2Ftext-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhlibpavlyk%2Ftext-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlibpavlyk%2Ftext-analyzer/lists"}