Compare commits
2 Commits
bbbd068da5
...
2d8c707d06
Author | SHA1 | Date | |
---|---|---|---|
2d8c707d06 | |||
4aaca6a998 |
@ -15,4 +15,4 @@ jobs:
|
|||||||
- name: List files in the repository
|
- name: List files in the repository
|
||||||
run: |
|
run: |
|
||||||
ls ${{ gitea.workspace }}
|
ls ${{ gitea.workspace }}
|
||||||
- run: source $HOME/.cargo/env && make
|
- run: make
|
||||||
|
4
Makefile
4
Makefile
@ -4,12 +4,14 @@ CFLAGS = -Wall -Werror -Wextra -Ofast -std=c2x
|
|||||||
all: build run valgrind build_risspam run_risspam
|
all: build run valgrind build_risspam run_risspam
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
@echo "Compiling retoor_c project.".
|
||||||
@# removed -pedantic flag because it doesn't accept ' for formatting numbers
|
@# removed -pedantic flag because it doesn't accept ' for formatting numbers
|
||||||
@# using printf
|
@# using printf
|
||||||
@$(CC) $(CFLAGS) isspam.c -o isspam
|
@$(CC) $(CFLAGS) retoor_c/isspam.c -o isspam
|
||||||
|
|
||||||
|
|
||||||
build_risspam:
|
build_risspam:
|
||||||
|
@echo "Compiling 12bitfloat_rust project."
|
||||||
cd 12bitfloat_rust/risspam && cargo run --release && cp target/release/risspam ../../
|
cd 12bitfloat_rust/risspam && cargo run --release && cp target/release/risspam ../../
|
||||||
|
|
||||||
|
|
||||||
|
14
README.md
14
README.md
@ -1,26 +1,31 @@
|
|||||||
# Isspam
|
# Isspam
|
||||||
Fast as light evaluator for text files to summarize specific details about the text files.
|
Fast as light evaluator for text files to summarize specific details about the text files.
|
||||||
|
This repository contains two versions of the same algorithm.
|
||||||
|
Versions:
|
||||||
|
- Rust (risspam) written by 12bitfloat.
|
||||||
|
- C (isspam) written by retoor.
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
```
|
```
|
||||||
make build
|
make build
|
||||||
```
|
```
|
||||||
Build with memory check (requires valgrind to be installed):
|
Build isspam with memory check (requires valgrind to be installed):
|
||||||
```
|
```
|
||||||
make valgrind
|
make valgrind
|
||||||
```
|
```
|
||||||
## Running
|
## Running
|
||||||
### Using files as parameter
|
### Using files as parameter
|
||||||
```
|
```
|
||||||
./isspam ./spam/*.txt
|
./(r)isspam ./spam/*.txt
|
||||||
./isspam ./not_spam/*.txt
|
./(r)isspam ./not_spam/*.txt
|
||||||
```
|
```
|
||||||
### Using stdin
|
### Using stdin
|
||||||
Useful for automation.
|
Useful for automation. Works only on the isspam version.
|
||||||
```
|
```
|
||||||
cat ./spam/example_spam1.txt | ./isspam
|
cat ./spam/example_spam1.txt | ./isspam
|
||||||
```
|
```
|
||||||
## Example output
|
## Example output
|
||||||
|
Output example made by isspam.
|
||||||
```
|
```
|
||||||
File: ./spam/example_spam3.txt
|
File: ./spam/example_spam3.txt
|
||||||
Capitalized words: 39
|
Capitalized words: 39
|
||||||
@ -47,6 +52,7 @@ Word count per sentence: 21
|
|||||||
Memory usage: 1 MB, 6.460 (re)allocated, 4.222 unqiue free'd, 0 in use.
|
Memory usage: 1 MB, 6.460 (re)allocated, 4.222 unqiue free'd, 0 in use.
|
||||||
```
|
```
|
||||||
## Valgrind status
|
## Valgrind status
|
||||||
|
Valgrind output for isspam version. Rust variant thinks it's too cool for memory checks afterwards.
|
||||||
Date: 2024-11-30
|
Date: 2024-11-30
|
||||||
```
|
```
|
||||||
==58062==
|
==58062==
|
||||||
|
Loading…
Reference in New Issue
Block a user