File size: 673 Bytes
bac4259
5bee7e5
 
 
 
 
bac4259
5bee7e5
bac4259
 
 
5bee7e5
bac4259
 
 
 
 
5bee7e5
bac4259
 
 
5bee7e5
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()