Skip to content

Comments

added coal, probab, db, automata books#7

Merged
qasimio merged 1 commit intomainfrom
packaging
Jan 16, 2026
Merged

added coal, probab, db, automata books#7
qasimio merged 1 commit intomainfrom
packaging

Conversation

@qasimio
Copy link
Owner

@qasimio qasimio commented Jan 16, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 16, 2026 15:09
@qasimio qasimio merged commit ea3a9cb into main Jan 16, 2026
3 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds four new computer science textbooks to the book database and introduces a new loading method in BookLoader specifically designed for the indexer process.

Changes:

  • Added four technical books: Computer Organization and Architecture, Introduction to Computer Theory, Assembly Language Programming, and Database System Concepts
  • Introduced loadBooksFromSource() method in BookLoader to read directly from the file system for indexing
  • Updated IndexerMain to use the new loading method

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 7 comments.

File Description
src/main/resources/data/book.json Added four new book entries (IDs 208-211) covering computer organization, automata theory, assembly programming, and databases
src/main/java/storage/BookLoader.java Added new loadBooksFromSource() method that reads directly from file system instead of resources, specifically for the indexer
src/main/java/core/IndexerMain.java Updated to use loadBooksFromSource() method and added unused IOException import

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"Assembly",
"I/O Systems"
],
"rating": "4.1",
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rating field should be a numeric value, not a string. The Book domain model expects a float type for the rating field. Change "4.1" to 4.1 (without quotes) to match the data type used in most other book entries.

Suggested change
"rating": "4.1",
"rating": 4.1,

Copilot uses AI. Check for mistakes.
"Computation",
"Computer Science"
],
"rating": "4.3",
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rating field should be a numeric value, not a string. The Book domain model expects a float type for the rating field. Change "4.3" to 4.3 (without quotes) to match the data type used in most other book entries.

Suggested change
"rating": "4.3",
"rating": 4.3,

Copilot uses AI. Check for mistakes.
"Machine Code",
"Low-Level Programming"
],
"rating": "4.5",
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rating field should be a numeric value, not a string. The Book domain model expects a float type for the rating field. Change "4.5" to 4.5 (without quotes) to match the data type used in most other book entries.

Suggested change
"rating": "4.5",
"rating": 4.5,

Copilot uses AI. Check for mistakes.
"Query Processing",
"Transaction Management"
],
"rating": "4.5",
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rating field should be a numeric value, not a string. The Book domain model expects a float type for the rating field. Change "4.5" to 4.5 (without quotes) to match the data type used in most other book entries.

Suggested change
"rating": "4.5",
"rating": 4.5,

Copilot uses AI. Check for mistakes.
import utils.TfIdfCalculator;

import java.io.File;
import java.io.IOException;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import is unused and should be removed. The code catches generic Exception rather than IOException specifically.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +27
try {
// Reads directly from the project folder, ignoring AppData
return mapper.readValue(new File("src/main/resources" + path), new TypeReference<List<Book>>() {});
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded path "src/main/resources" may cause issues when running from a JAR or in different environments. Consider making this configurable or using a more robust resource loading approach that works consistently across different runtime contexts.

Suggested change
try {
// Reads directly from the project folder, ignoring AppData
return mapper.readValue(new File("src/main/resources" + path), new TypeReference<List<Book>>() {});
// Load from classpath so this works both in development and from a packaged JAR
try (InputStream inputStream = getClass().getResourceAsStream(path)) {
if (inputStream == null) {
// Resource not found on classpath
return Collections.emptyList();
}
return mapper.readValue(inputStream, new TypeReference<List<Book>>() {});

Copilot uses AI. Check for mistakes.
"title": "Assembly Language Programming and Organization of the IBM PC",
"author": "Ytha Y. Yu, Charles Marut",
"description": "A comprehensive tutorial-style guide to assembly language programming on the IBM PC, covering microcomputer systems, representation of numbers and characters, instruction sets, memory and I/O organization, BIOS/DOS interrupts, graphics and keyboard programming, and advanced topics with practical examples and exercises.",
"progLang": "English",
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The progLang field should be "Assembly" rather than "English" since this book is specifically about assembly language programming for the IBM PC. This would be consistent with book 208 which also uses "Assembly" for assembly-related content.

Suggested change
"progLang": "English",
"progLang": "Assembly",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant