-64
COVERSHEET.md
-64
COVERSHEET.md
···-Search a provided old testament text file for arbitrary reference. It prompts the user for book, chapter, and verse and then searches for that verse. If book is not found then output `Book does not exist in the Old Testament`. If chapter isn't found then `Chapter # does not exist in Book`. Finally if the verse isn't found then output `Verse # does not exist in Book #`. Once the verse is found then append the verse to `verses.txt`.-I started with outlining the basic input system [`532c6cf`](https://github.com/cu-cs1210/lab-6-kieranklukas/commit/5b2ced23798fc7cbce79eb445c9592cccf16d6a6). Then worked on setting up a while loop to read the file line by line. I spent a while puzzling over exactly how I wanted to implement this and I am not entirely satisfied with my current solution. It would be interesting to try this problem in a functional language like gleam or erlang and see how much more cleanly I can parse the file. I implemented each reference part sequentially and then went back and made it check for barrier strings to stay within the proper book and chapter. I ended up realizing that the book of Psalms is referenced differently and so made some logic to permit its idiosyncracies [`7c18fff`](https://github.com/cu-cs1210/lab-6-kieranklukas/commit/7c18fffa30ab3e43bcb05ad4dff44f275987cbb8).-I used a single input variable to parse the file word by word until we get to the correct verse. I also check if the input book is listed as `Psalm` or `Psalms` and add or remove an `s` when doing checks or output as appropriate. The output file is also never opened until we find the verse and is immediately closed afterward. Also a minor note of intrest is that you can change the default paths that the program loads from and saves to by adding the paths as arguments (eg. `lab66 test/OT.txt build/verses.txt`).-I updated the `makefile` to add `make run` so I could compile and run it more easily and updated the test file to have the Zylabs test states as well as more granularly check a happy path and some adversarial paths.-<!--Did you get help from anyone else on this project? Document their contribution to your learning.-->-No outside help was used beyond minor googling for how to capitalize an entire string and the proper syntax for appending (not covered in zybooks as far as I can tell but I'm sure you will cover it in lectures next week).-The program works well and should cover most edgecases! As far as I can tell there isn't anything that should be able to break it beyond changing the `OT.txt` to be several GB in size.-I used claude to generate a more complex test file and then modified it to add the rest of the zybooks tests as I got closer to finishing the project.-<!--List any lessons learned. What might you have done differently if you were going to attack this again.-->-I would definetly want to try a different language for sure if I was doing this independantly but overal I think this implementation is fairly solid and I wouldn't change much. I did find out in this lab that it is always a good idea to check the whole input or you might run into weird bugs like how `PSALMS` is formatted.
+15
-63
README.md
+15
-63
README.md
···-For this lab the program must parse `OT.txt` (format below) to find specific references and produce scoped errors if the reference isn't found.-2 And the earth was without form, and void; and darkness [was] upon the face of the deep. And the Spirit of God moved upon the face of the waters.+[](https://hex.pm/packages/bible_search_gleam)+[](https://hexdocs.pm/bible_search_gleam/)-1 Blessed [is] the man that walketh not in the counsel of the ungodly, nor standeth in the way of sinners, nor sitteth in the seat of the scornful.-3 And he shall be like a tree planted by the rivers of water, that bringeth forth his fruit in his season; his leaf also shall not wither; and whatsoever he doeth shall prosper.-<img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/main/.github/images/line-break.svg" />-<i><code>© 2025-present <a href="https://github.com/taciturnaxololt">Kieran Klukas</a></code></i>-<a href="https://github.com/cu-cs1210/lab-6-kieranklukas/blob/main/LICENSE.md"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8"/></a>
docs/freeze.jpeg
docs/freeze.jpeg
This is a binary file and will not be displayed.
+21
gleam.toml
+21
gleam.toml
···
-16
makefile
-16
makefile
+16
manifest.toml
+16
manifest.toml
···+{ name = "filepath", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "B06A9AF0BF10E51401D64B98E4B627F1D2E48C154967DA7AF4D0914780A6D40A" },+{ name = "gleam_stdlib", version = "0.65.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "7C69C71D8C493AE11A5184828A77110EB05A7786EBF8B25B36A72F879C3EE107" },+{ name = "gleeunit", version = "1.6.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "FDC68A8C492B1E9B429249062CD9BAC9B5538C6FBF584817205D0998C42E1DAC" },+{ name = "input", version = "1.0.1", build_tools = ["gleam"], requirements = [], otp_app = "input", source = "hex", outer_checksum = "FE84CDADC78A1367E4AFD561A529825A8FEC88D165CBDF511FD3226CABCDEE6F" },+{ name = "simplifile", version = "2.3.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0A868DAC6063D9E983477981839810DC2E553285AB4588B87E3E9C96A7FB4CB4" },
+47
src/bible_search.gleam
+47
src/bible_search.gleam
···
-143
src/lab66.cpp
-143
src/lab66.cpp
···-cout << (normalizedBook == "PSALM" ? book += "s" : book) << " does not exist in the Old Testament";
test/OT.txt
OT.txt
test/OT.txt
OT.txt
+13
test/bible_search_gleam_test.gleam
+13
test/bible_search_gleam_test.gleam
-362
test/test.sh
-362
test/test.sh
···-resp=$(timeout "$test_timeout" bash -c "echo -e '$basic_input' | '$program' OT.txt '$output_file'" 2>&1)-print_result "File Output" "PASS" "verses.txt created with correct content in build directory"-output=$(timeout "$test_timeout" bash -c "echo -e '$input' | '$program' OT.txt '$output_file'" 2>&1)-run_verse_test "Exodus 20:3" "Exodus" "20" "3" "3 Thou shalt have no other gods before me" true-run_verse_test "Psalm 23:1" "Psalm" "23" "1" "1 The LORD [is] my shepherd; I shall not want." true-run_verse_test "Invalid Book" "Matthew" "1" "1" "Matthew does not exist in the Old Testament" false-run_verse_test "Invalid Chapter" "Esther" "18" "3" "Chapter 18 does not exist in Esther" false-run_verse_test "Lowercase Book" "genesis" "1" "1" "1 In the beginning God created the heaven and the earth." true-run_verse_test "Mixed Case Book" "GEnesis" "1" "1" "1 In the beginning God created the heaven and the earth." true-run_verse_test "First Samuel" "First Samuel" "1" "1" "1 Now there was a certain man of Ramathaim-zophim, of mount Ephraim, and his name [was] Elkanah, the son of Jeroham, the son of Elihu, the son of Tohu, the son of Zuph, an Ephrathite:" true-run_verse_test "Second Kings" "Second Kings" "1" "1" "1 Then Moab rebelled against Israel after the death of Ahab" true-output1=$(timeout "$test_timeout" bash -c "echo -e '$input1' | '$program' OT.txt '$output_file'" 2>&1)-output2=$(timeout "$test_timeout" bash -c "echo -e '$input2' | '$program' OT.txt '$output_file'" 2>&1)-if [[ "$second_content" == *"1 In the beginning God created the heaven and the earth"* ]] && [[ "$second_content" == *"2 And the earth was without form, and void"* ]]; then-elif [[ "$second_content" == *"2 And the earth was without form, and void"* ]] && [[ "$second_content" != *"1 In the beginning God created the heaven and the earth"* ]]; then-output=$(timeout "$test_timeout" bash -c "echo -e '$input' | '$program' '$file_path' '$output_file'" 2>&1)-output=$(timeout "$test_timeout" bash -c "echo -e '$input' | '$program' OT.txt '$output_file'" 2>&1)-print_result "$test_name" "FAIL" "Expected error message '$expected_pattern' not found: $output"-run_file_path_test "Existing File (Absolute)" "/Users/kierank/code/school/lab-6/test/OT.txt" "" true