SELECTED BUILDS   /   ENGINEERING NOTES

Inside the work.

Three projects, unpacked from problem to implementation. Each walkthrough follows the documented project details and makes the flow visible: the steps, decisions, and components that turn an idea into a working system.

01 / NLP · DATABASE SYSTEMS · 2024

Ask a question.
Get a query.

A natural language interface for relational data. The system transforms a question into SQL through discrete, inspectable stages, using approximate matching to handle wording variation.

PYTHON / SQL / NLP

Query generation pipeline

Question → structured SQL
01 · InputNatural language“show recent orders”
→
02 · NormalizeTokenize & n-gramsunigram + phrases
03 · ResolveTable + columnsLCS / similarity
→
04 · ComposeSQL clausesfilters + ordering
05 · OutputExecutable SQLSELECT / WHERE

What happens at each stage

01
Normalize the wordingPreprocess text and build unigram and n-gram representations for matching.
02
Choose the relevant tableCompare query phrases against table names using longest common subsequence and neighboring similarity scoring.
03
Map intent to columnsUse similarity thresholds to associate natural language with database fields.
04
Build and order the queryGenerate conditions, AND / OR combinations, comparison operators, and ORDER BY direction.

The problem

Users who understand their data may not know the schema or SQL syntax needed to query it directly.

Design choices

  • Approximate matching over exact keyword-only rules.
  • Separate pipeline stages for easier maintenance.
  • Detect numeric versus string values before composing conditions.

Query capabilities

SELECT and WHERE construction, multiple conditions, six comparison operators, and natural-language sorting cues.

PythonSQLN-gramsLCS
Engineering takeaway   Keeping table selection, field matching, condition extraction, and SQL generation as separate modules makes it easier to improve one decision without entangling the entire translation flow.
02 / DOCUMENT ANALYSIS · NLP · 2024

Similarity you
can inspect.

A PDF analysis workflow that compares documents, groups related matches, and highlights shared phrases directly in annotated copies for human review.

PYTHON / PYMUPDF / NLP

Document analysis flow

PDF AExtract textPyMuPDF / PyPDF2
⇄
PDF B…NExtract textNormalize content
Tokenize1 / 2 / 3-gramsword sequences
→
Compare3 distance methodsscore → percent
ClusterTransitive groupsshared relationships
→
AnnotateHighlight phrases5-gram matches

Comparison and review loop

A
Extract & tokenizeProcess PDFs and produce unigram, bigram, and trigram representations.
B
Calculate similarityCompare frequency vectors with cosine similarity, and include Manhattan and Euclidean distance methods.
C
Apply threshold & clusterConvert similarity to a 0–100 score, flag against a configurable threshold, and group transitive relationships.
D
Show the evidenceFind common 5-gram phrases and add highlights to annotated PDF copies for review.

Multiple signals

Combining three n-gram levels helps account for phrase overlap at different scales. Multiple distance methods let users evaluate similarity in different ways.

From pairs to groups

Transitive clustering represents indirect connections too: if one document links to a second, and the second to a third, they appear in the same group.

Reviewable output

Scores identify candidates; highlighted matching phrases help a person inspect why the documents were connected.

Cosine similarityManhattanEuclideanPyMuPDF
Engineering takeaway   Separating extraction, tokenization, scoring, clustering, and annotation keeps the analysis pipeline understandable and makes individual algorithms easier to change.
03 / C++ · GAME LOGIC · 2023

Rules first.
Then the interface.

A desktop implementation of Baagchal, the traditional Nepali strategy game. The core rules and game state are modeled independently from the SFML presentation layer.

C++ / SFML / OOP

Game state and move validation

Illustrative board · validated move path pulses

Separation of responsibilities

// One action, several explicit steps input → validate_move() → apply_move() → update_state() → check_win_condition() → render_board() // Game rules remain distinct from display.
01
Read player inputSFML event handling receives the requested interaction.
02
Validate against rulesCheck legal positions, movement rules, turns, and captures.
03
Update and renderMaintain board state and draw the resulting position in the game loop.

Game engine

Tracks player turns, board state, valid movement, captures, and win-condition detection for both tigers and goats.

Interaction

SFML provides the graphical board, user input, piece movement, and real-time state updates in a desktop game loop.

Maintainability

Object-oriented design keeps game entities, board state, movement logic, and user interaction in distinct components.

C++SFMLOOPGame loop
Engineering takeaway   Separating the rules engine from rendering means the core game mechanics can be reasoned about independently from how the board is drawn.