Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 22nd, 2005, 5:44 AM   #1
foxcity911
Programmer
 
Join Date: Jun 2005
Location: Queensland
Posts: 37
Rep Power: 0 foxcity911 is on a distinguished road
translator

hi
is it possible to create in php a script that can translate, say, english into pig latin?

also would it be an easy task to make the words have different 'extensions' depending on their first letters?

for eg. butterfly could be translated into utterflybelly and dragonfly could be translated to ragonflydobbly

another, is it possible to make the script ignore certain words such as 'if' 'and' 'an' and replace them with 'uf' 'und' 'un' respectively?

thanks alot.
foxcity911 is offline   Reply With Quote
Old Jul 22nd, 2005, 7:08 AM   #2
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
yup just use the string class i am sure there is a string replace in the php list somewhere :/.

www.php.net
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote
Old Jul 22nd, 2005, 7:56 AM   #3
Broax
Hobbyist Programmer
 
Broax's Avatar
 
Join Date: Jan 2005
Location: Porto, Portugal
Posts: 142
Rep Power: 4 Broax is on a distinguished road
Send a message via MSN to Broax
what's pig latin?
__________________
PORTUGALPORTUGA
PORTUGALPORTUGA
PORTUGALPORTUGA
PORTUGALPORTUGA
PORTUGALPORTUGA
Broax is offline   Reply With Quote
Old Jul 22nd, 2005, 9:14 AM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Your mileage may vary, but typically it goes like this: if a word begins with a consonant, you move the consonant to the end and add "ay". Pig ==> igpay. If it begins with a vowel, you mostly just add "ay." Multisyllabic words are often modified by syllables: umbrella ==> umbray ella-ay.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jul 22nd, 2005, 11:34 PM   #5
foxcity911
Programmer
 
Join Date: Jun 2005
Location: Queensland
Posts: 37
Rep Power: 0 foxcity911 is on a distinguished road
could you show me a piece of code that replaces a user inputted word into its piglatin counterpart? i understand the basic "replace" rule but i dont want it to simply replace but "rearrange." Otherwise i'd have to make it practically a translator and have to type in every word ever created, which i would think take a fairly long time.

thanks alot
foxcity911 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:43 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC