Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Print synonyms if they are found*/
- if (pointer_array[word_count - 1][1] != NULL) {
- if (length + strlen(pointer_array[word_count - 1][1]) + 2 >= linelen) {
- /* If there is a punctuation mark before line change, switch to uppercase for first letter */
- if (strstr(punctuation, pointer_array[word_count - 2][0]) != NULL) {
- *(pointer_array[word_count - 1][1]) = toupper( * (pointer_array[word_count - 1][1]));
- printf("\n(%s)", pointer_array[word_count - 1][1]);
- length = strlen(pointer_array[word_count - 1][1]) + 2;
- *(pointer_array[word_count - 1][1]) = tolower( * (pointer_array[word_count - 1][1]));
- }
- /* Print word in new line */
- else {
- printf("\n(%s)", pointer_array[word_count - 1][1]);
- length = strlen(pointer_array[word_count - 1][1]) + 2;
- }
- }
- /* If previous word is punctuation mark, switch to uppercase for first letter */
- else if (strstr(punctuation, pointer_array[word_count - 2][0]) != NULL) {
- *(pointer_array[word_count - 1][1]) = toupper( * (pointer_array[word_count - 1][1]));
- printf(" (%s)", pointer_array[word_count - 1][1]);
- length += strlen(pointer_array[word_count - 1][1]) + 3;
- *(pointer_array[word_count - 1][1]) = tolower( * (pointer_array[word_count - 1][1]));
- }
- /* Print word */
- else {
- printf(" (%s)", pointer_array[word_count - 1][1]);
- length += strlen(pointer_array[word_count - 1][1]) + 3;
- }
- }
- } while (pointer_array[word_count][0] != NULL && word_count < MAX_WORDS);
- printf("\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement