diff options
| author | 2026-11-08 04:40:54 +0000 | |
|---|---|---|
| committer | 2026-11-08 04:40:54 +0000 | |
| commit | 863a5d838205c52c9a0134897b5ee28164f87295 (patch) | |
| tree | 5da38214ca58017ace71a500fbd25b5e7d341994 /README.org | |
| download | coursework-master.tar.gz | |
Diffstat (limited to 'README.org')
| -rw-r--r-- | README.org | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/README.org b/README.org new file mode 100644 index 0000000..17f73af --- /dev/null +++ b/README.org | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | #+title: Monads in Haskell | ||
| 2 | #+date: 2024H2 | ||
| 3 | |||
| 4 | * Task | ||
| 5 | :PROPERTIES: | ||
| 6 | :CUSTOM_ID: task | ||
| 7 | :END: | ||
| 8 | Implement two syntax analyzers that solve the following tasks: | ||
| 9 | 1. Develop a parser for processing strings from a text file. It has | ||
| 10 | to: | ||
| 11 | - Read lines containing values and binary operations from a text | ||
| 12 | file (=.txt=), the name of which is entered by the user. | ||
| 13 | - Parse values represented by integers in decimal the number | ||
| 14 | system. | ||
| 15 | - Process binary operations: addition, subtraction, multiplication. | ||
| 16 | division. | ||
| 17 | - Calculate the result of an expression and display it on the | ||
| 18 | screen. | ||
| 19 | 2. Develop a text parser and text continuation generator. Tasks: | ||
| 20 | 1. Read the text from the file, the name of which is entered by the | ||
| 21 | user, and perform its syntactic analysis: | ||
| 22 | - Split the text into sentences using the following rules: words | ||
| 23 | consist only of letters; sentences consist of words and | ||
| 24 | separated by characters: =.!?;:()=. | ||
| 25 | - Remove all punctuation characters and numbers from the text. | ||
| 26 | 2. Build an N-gram model: | ||
| 27 | - Use bigrams and trigrams. | ||
| 28 | - Create a dictionary where the keys are one word or a pair | ||
| 29 | words, and values --- lists of all unique possible | ||
| 30 | continuations. | ||
| 31 | - Save the dictionary to a text file (=.txt=). | ||
| 32 | 3. Implement user interaction: | ||
| 33 | - When entering one or a couple of words, return a random | ||
| 34 | string. a text of 2 to 15 words, based on the created | ||
| 35 | dictionary. | ||
| 36 | - If the entered word is not in the dictionary keys, display a | ||
| 37 | message indicating this. | ||
| 38 | 4. Organize a dialogue between two N‑gram models created based on | ||
| 39 | two different texts: | ||
| 40 | - The user specifies an initial word or a pair of words and the | ||
| 41 | number of messages (the depth of the dialogue). | ||
| 42 | - The answer of each model is based on the last word (or the | ||
| 43 | penultimate one, if the latter is not in the dictionary) of | ||
| 44 | the opponent's previous message. | ||
| 45 | |||
| 46 | Use works of art as texts for building models: *Ilfa and Petrov* | ||
| 47 | |||
| 48 | * Documentation | ||
| 49 | :PROPERTIES: | ||
| 50 | :CUSTOM_ID: documentation | ||
| 51 | :END: | ||
| 52 | The exported report can be found at [[https://git.michalec.dev/files/uni/term-05/func-prog/coursework/report.pdf][this link]]. | ||
| 53 | |||
| 54 | * Unlicense | ||
| 55 | :PROPERTIES: | ||
| 56 | :CUSTOM_ID: unlicense | ||
| 57 | :END: | ||
| 58 | #+include: UNLICENSE verse | ||
