UDP Client-Server Communication for Translating “New Generation English” to Formal English
Experiment
UDP Client-Server Communication for Translating “New Generation English” to Formal English
Aim
To design and implement a UDP client-server program where the client sends a sentence with abbreviations, and the server translates it into formal English.
Objective
- To understand UDP-based communication
- To implement string processing at the server side
- To perform real-time translation using predefined mappings
Theory
🌐 UDP Communication
UDP is a connectionless protocol:
- No connection establishment
- Faster communication
-
Uses
sendto()andrecvfrom()
🧠 Concept Used
- Client sends a sentence with abbreviations
- Server replaces abbreviations using a predefined dictionary
- Translated sentence is sent back
📘 Abbreviation Mapping
| Abbreviation | Meaning |
|---|---|
| tbh | to be honest |
| ig | I guess |
| tbf | to be fair |
| atm | at the moment |
| irl | in real life |
| lol | laughing out loud |
| asap | as soon as possible |
| omg | oh my God |
| ttyl | talk to you later |
| idk | I don’t know |
| nvm | never mind |
Algorithm
Client
- Create UDP socket
- Input sentence from user
- Send sentence to server
- Receive translated sentence
- Display result
Server
- Create UDP socket
- Bind to port
- Receive sentence from client
- Replace abbreviations with full forms
- Send translated sentence back
💻 Program
🔹 Server Program (UDP in C)
🔹 Client Program (UDP in C)
▶️ Compilation and Execution
Run:
-
Terminal 1 →
./server -
Terminal 2 →
./client
📌 Sample Output
Client Input
Client Output
⚠️ Limitations
- Only predefined abbreviations are translated
- Case-sensitive (e.g., “LOL” not handled)
- Punctuation handling is basic
✅ Result
The UDP client-server program successfully translated informal English abbreviations into formal English and returned the result to the client
This experiment also demonstrates UDP-based communication and highlights how simple string processing can be integrated into network applications.
Comments
Post a Comment