├── .gitignore ├── README.md ├── assets ├── graph_exemple.png └── usage.txt ├── bin ├── build.sh ├── main ├── run.sh └── test ├── source ├── bufferf.pas ├── clickf.pas ├── colorf.pas ├── entryf.pas ├── errorf.pas ├── files │ └── exemple_file ├── graphf.pas ├── graphs │ └── exemple_file.out ├── handlerf.pas ├── inputf.pas ├── main.pas ├── parserf.pas ├── pfile.pas ├── ptypef.pas ├── queuef.pas ├── string_viewf.pas ├── tokenizerf.pas └── treef.pas └── todo.md /.gitignore: -------------------------------------------------------------------------------- 1 | source/main 2 | source/test 3 | source/test.pas -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TEXT AUTO COMPLETE PROJECT 2 | This projet implements the text auto complete feature found in most of today's applications 3 | 4 | ## 5 | 6 | ## PROJECT STRUCTURE 7 | 8 | ``` 9 | . 10 | ├── assets 11 |    └── usage.txt 12 | 13 | ├── bin 14 |    ├── build.sh 15 |    ├── main 16 |    ├── run.sh 17 |    └── test 18 | 19 | ├── source 20 |    ├── clickf.pas 21 |    ├── colorf.pas 22 |    ├── entryf.pas 23 |    ├── errorf.pas 24 |   ├── graphf.pas 25 | ├── handlerf.pas 26 |    ├── inputf.pas 27 |    ├── main.pas 28 |    ├── parserf.pas 29 |    ├── pfile.pas 30 |    ├── ptypef.pas 31 |    ├── queuef.pas 32 |    ├── stackf.pas 33 |    ├── string_viewf.pas 34 |    ├── test.pas 35 |    ├── tokenizerf.pas 36 |    └── treef.pas 37 | 38 |    ├── files 39 |       └── exemple_file 40 |    ├── graphs 41 |       └── exemple_file.out 42 | 43 | ├── todo.md 44 | ├── README.md 45 | ``` 46 | 47 | ## EXPLANATION 48 | This project is implemented using the prefix-tree data structure 49 | 50 | ### FILES: 51 | 52 | + treef.pas: contains the implementation of the prefix-tree data structure (more about the prefix-tree data structure [click here](https://en.wikipedia.org/wiki/Trie)) 53 | 54 | + inputf.pas: handles the user input on the command line depends on the files: 55 | + lexerf.pas: for lexing the user input (more about lexing [click here](https://www.geeksforgeeks.org/introduction-of-lexical-analysis/)) 56 | 57 | + tokenizerf.pas: for tokenizing the user input (more about tokenizing [click here](https://www.geeksforgeeks.org/nlp-how-tokenizing-text-sentence-words-works/)) 58 | 59 | + parserf.pas: for parsing the user input and generating output (more about parsing [click here](https://www.geeksforgeeks.org/introduction-of-parsing-ambiguity-and-parsers-set-1/)) 60 | 61 | + clickf.pas: for collecting the data from the user on the command line 62 | 63 | + errorf.pas: for the error handling 64 | 65 | + bufferf.pas: implements the buffer data structure (more about the buffer data structure [click here](https://www.geeksforgeeks.org/gap-buffer-data-structure/)) 66 | 67 | + queuef.pas: implements the queue data structure (more about the queue data structure [click here](https://geeksforgeeks.org/queue-data-structure/)) 68 | 69 | + string_viewf.pas: implements the string view data structure (more about the string view data structure [click here](https://www.geeksforgeeks.org/class-stdstring_view-in-cpp-17/)) 70 | 71 | + main.pas: the main file, it generates the project output! 72 | 73 | 74 | ## Getting Started 75 | 76 | Follow these instructions to compile and run the programs: 77 | 78 | ### Prerequisites 79 | 80 | - **FREE PASCAL COMPILER**: Make sure you have **fpc** installed to compile the [**PASCAL**](https://www.freepascal.org/) programs. 81 | 82 | ### Compilation 83 | 84 | To compile the programs, use the following commands in your terminal: 85 | 86 | ```bash 87 | $ cd bin 88 | $ ./build.sh 89 | ``` 90 | 91 | 92 | ## Usage 93 | 94 | #### EXECTUING 95 | After compiling, run the programs as follows: 96 | ```bash 97 | $ ./run.sh 98 | ``` 99 | 100 | # 101 | 102 | 103 | #### COMMANDS 104 | 105 | ``` 106 | COMMANDS: 107 | :add * : to add one or more files to the tree! 108 | :show ! : show all the words available in the tree! 109 | options: 110 | -dir : show the current directory for the files! 111 | -gdir : show the directory where the graphs are located! 112 | :dir