Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the C programming language a) All input files will be KWIC version 1 files. - KWIC is key word in context. We are to

Use the C programming language

a) All input files will be KWIC version 1 files.

- KWIC is key word in context. We are to make a file in c.

-The input file has a version number (for this assignment the version is 1), followed by a line with ::. There then follow the list of exclusion words, one word per line, which list it itself ended with another ::. Lastly the remainder of the file is made up of the lines-for-indexing of which the KWIC index will constructed for that file.

b) At most 20 exclusion words will appear in an input file, and each word will be no more than 20 characters in length. It is possible that there are no exclusion words. Ignore any duplication in exclusion words.

c) At most 100 lines-for-indexing will appear in an input file, and each line is less than 70 characters in length. Page 6 of 6

d) Amongst all lines-for-indexing, there will be at most 100 distinct indexed words (i.e., if you count capitalized words an eliminate duplicates, there will be at most 100 such words).

e) Indexed words will appear at most once in any line-for-indexing.

f) All lines-for-indexing will be in lower case; words are separated by single spaces; and there is no punctuation.

g) Decimal numbers are treated as indexed words; use lexicographic (i.e., alphabetical) ordering for determining where line-for-indexing containing such a word should appear in the output.

h) If an indexed word appears in more than one line-for-indexing, print the lines in the order they appear in the input.

Read stdin line by line and processing each line appropriately.

Read and store exclusion words.

Read and store lines-for-indexing

Create the output index by using

Create and use arrays in a non-trivial array.

Use the -std=c99 flag when compiling to ensure your code meets the ISO/IEC 9899:1999 standard for C.

No usage of malloc, calloc or any of the dynamic memory functions. and not to hardcode filenames.

Each line in the output contains text based on one line-for-indexing of the input with exactly one word capitalized. When reading the output line-by-line (i.e., from top to the bottom) the capitalized words are in alphabetical order. Some lines-for-indexing appear more than once in the output as they have more than one indexed word.

the input file:

1

:: :: ccc bbb aaa 

And the outpout File it code needs to match:

ccc bbb AAA ccc BBB aaa CCC bbb aaa 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

ISBN: 0201844524, 978-0201844528

More Books

Students also viewed these Databases questions