A terminal-based chatbot inspired by the classic ELIZA program written in C.
Developed for the Programming course of the LEEC degree at Instituto Superior Técnico.
Explore the project »
Report Bug
·
Request Feature
Table of Contents
This repository contains a chatbot inspired by the classic ELIZA program, one of the earliest natural language processing systems.
The chatbot uses pattern matching and keyword recognition techniques to simulate conversations with the user through a terminal interface.
Features included in the project:
- Interactive command-line interface
- Keyword-based response generation
- Rule-based conversational logic
- Modular C code structure
The project was developed with a focus on practicing fundamental programming concepts such as:
- Dynamic memory management
- String manipulation
- Modular software design
- File organization and compilation workflows
- C90
- GCC
- Makefile
Using GCC:
gcc *.c -o elizaOr using the Makefile:
make./elizaMostra esta ajuda e termina // Shows this help and exits
-h Ficheiro com base de dados de respostas (por omissao: eliza.dat) // Sets the question/answer database, uses eliza.dat by default
-f filename Ficheiro de entrada (por omissao: stdin) // Sets input file, by default uses stdin
-i filename Ficheiro de saida (por omissao: stdout) // Sets output file, by default uses stdout
-o filename Ficheiro de log do input e output // Sets the log file for input/output
-l filename Usar regras de portugues em vez de ingles // Uses portuguese conjugation rules
-p After launching the program, the chatbot will prompt the user for input through the terminal.
Example interaction:
ELIZA: HI! I'M ELIZA. LET'S TALK. TYPE `BYE' TO END THIS SESSION.
You: Hi
ELIZA: HOW DO YOU DO. PLEASE STATE YOUR PROBLEM.
You: Why are you screaming ?
ELIZA: WHY ARE YOU INTERESTED IN WHETHER OR NOT I AM SCREAMING?
You: I am scared
...
This project was developed for the Programming course of the Electrical and Computer Engineering degree (LEEC) at Instituto Superior Técnico during the 2025/2026 academic year.
The objective of the assignment was to implement a chatbot similar to the original ELIZA system while applying the programming concepts taught throughout the course.
The source code contains informal comments and internal jokes written during development. These do not affect functionality and were kept to preserve the development process and collaboration context.
Due to the academic nature of this project, all comments are written in Portuguese
Developed collaboratively by:
This project was developed for academic purposes as part of a university course and is not intended for reuse, distribution, or modification.