GithubHelp home page GithubHelp logo

text-index_20_11's Introduction

Text index

This program works with files in .txt format, composes an index of the text file and responds to user requests.

Text files consist of lines, lines are collected into pages (each page contains exactly 45 lines, blank lines are not counted).

Description of correct format of input data:

  1. Filename
    • one file in .txt format
    • the file contains coherent text in Russian
  2. Type of request
    • one number from 1 to 3
  3. Request
    • correct input data (see Correct input data for selected request)
  • There must be separators (one space) between 1, 2 and 3 inputs.

Types of requests:

  1. Compilation of an index for a given file in txt format.
    Correct input data: nothing

  2. Displaying information for a given file with a text index:

    • a list of a given number of the most common words;
      Correct input data: one natural number

    • complete information about the use of a given word (number of occurrences, used word forms, page numbers)
      Correct input data: one word in Russian in initial form

    • data on the use of words from a given group (for example, pieces of furniture, verbs of movement, etc.).
      Correct input data: several words in Russian in initial form, separated by spaces

  3. Displays all lines containing the specified word (in any of the word forms).
    Correct input data: one word in Russian in initial form

Output

  1. Compilation of an index for a given file in txt format.
    Output:

    The index is built.

  2. Displaying information for a given file with a text index:

    • a list of a given number of the most common words;
      Output: a list of words separated by commas with a space.
      If the number of different words in the text is less than the specified number, all words will be displayed.

    • complete information about the use of a given word (number of occurrences, used word forms, page numbers)
      Word in initial form!

      Output:

      Word:
      Number of occurrences:
      Used word forms:
      Page numbers:

      Word ... was not found.

    • data on the use of words from a given group (for example, pieces of furniture, verbs of movement, etc.).
      Output: information output for each word in blocks from the previous paragraph. Blocks are separated by blank lines.

  3. Displays all lines containing the specified word (in any of the word forms).
    Word in initial form!
    Output: lines containing the specified word, separated by blank lines.

Example

$ ./gradlew run --args="data/MyText.txt 2 плакать"

Word: плакать
Number of occurrences: 1
Used word forms: плакать
Page numbers: 1

text-index_20_11's People

Contributors

mamaria-k avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.