Spaces:
Sleeping
Sleeping
| import sys | |
| from ginger import correct_sentence | |
| def main(): | |
| """ | |
| Main application function. | |
| Accepts input via command-line arguments and corrects grammar using the Ginger API. | |
| """ | |
| if len(sys.argv) < 2: | |
| print("Please provide a sentence as an argument.") | |
| sys.exit(1) | |
| # Combine all command-line arguments into one sentence | |
| text = ' '.join(sys.argv[1:]) | |
| # Correct the sentence using the Ginger API | |
| corrected_text = correct_sentence(text) | |
| # Display the original and corrected sentences | |
| print(f"Original Sentence: {text}") | |
| print(f"Corrected Sentence: {corrected_text}") | |
| if __name__ == "__main__": | |
| main() | |