![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Jun 2005
Location: Queensland
Posts: 37
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
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 |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
what's pig latin?
![]()
__________________
PORTUGALPORTUGA PORTUGALPORTUGA PORTUGALPORTUGA PORTUGALPORTUGA PORTUGALPORTUGA |
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Jun 2005
Location: Queensland
Posts: 37
Rep Power: 0
![]() |
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|