- Summary
- The KWIC system
- The Deliverable
- User Guide
- Setting up the Key Word In Context System to Run Locally
The Key Word In Context (KWIC) system is designed to generate an index of all circular shifts of input lines, sorted in ascending alphabetical order. Developed as part of a larger web search engine project, the KWIC system accepts ordered sets of lines, where each line consists of words which are just a series of characters.
• Accept an ordered set of lines as input.
• Circularly shift each line by repeatedly removing the first word and appending it at the end of the line.
• Output a list of all circular shifts of all lines in ascending alphabetical order.
• Understandable, portable, scalable, and reusable
• User-friendly, responsive, and adaptive
The KWIC system consists of a user interface where users can input lines of text, compute the KWIC index, and view the results.
• The KWIC system can be accessed through a web browser.
• Some local setup is required since I will not host this toy project.
- Input: Users enter lines of text into the provided text area.
- Compute: After inputting text, users click the “Compute” button to generate the KWIC index.
- Output: The KWIC index is displayed in a read-only text area below the input.
- Clear Input/Output: Users can clear the input or output by clicking the respective “Reset Input” or “Reset Output” buttons.
- To Input Text, enter lines of text into the text area provided, by clicking inside the text area and then using your keyboard or other input method.
• Each line consists of words separated by spaces.
• Only characters a…z, A…Z are accepted by the system, others will be erased.
Figure 1. Demonstration of inputting text into the KWIC Text Area Input
- After Inputting Text, click the “Compute” button to generate the KWIC Index.
• The system will process the input and display the result in the output text area that is read only.
• Each line in the KWIC Index represents a circular shift of the original text, and sorted in alphabetical order.
Figure 2. Demonstration of output text from the example input
- To clear the input text, click the “Reset Input” button.
• It will only clear the input text.
Figure 3. Demonstration of clearing input text from the example input
- To clear the output text, click the “Reset Output” button.
• It will only clear the output text.
Figure 4. Demonstration of clearing output text from the example input
Because the Key Word In Context System is not hosted online with a Domain, you must run it from the zip file that is provided from Github in Local Host 3000.
-
Download the source code file from Github
-
In the terminal, where the project is located, do the command:
npm install
• This will download all the dependencies in the KWIC project.
• Note that this will require 288 MB of memory on your PC.
- In the terminal, do the command:
npm run dev
• This will run your program in localhost:3000
• Ensure that nothing else is running on localhost:3000 before doing this
- Navigate to localhost:3000 in your preferred browser.
• This will let you run the KWIC program in development mode.
• If you want a production build, you will instead do the npm run build command.
Figure 5. KWIC system displayed in your browser at localhost:3000