Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-05-2007, 08:21 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
a or an

Well, when you see title I think that you think it's something about grammar,
well, script wise it is; is there a way to see if a string should have 'a' or 'an' infront? Instead of having a private function like..

PHP Code:
temp.foo = { "a""e""u""i""o""y"};
temp.bar "test";

return ( 
temp.bar.substring01in temp.foo "an" "a"SPC temp.bar;

// would produce 'a test' 
Is there an easier way? ( well, thats easy, just looking if there is a built-in or something, or it could of been suggested..)
__________________

Last edited by Chompy; 01-05-2007 at 08:34 PM..
Reply With Quote
  #2  
Old 01-05-2007, 08:25 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
PHP Code:
if (this.string.starts("an")) { ... } 
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 01-05-2007, 08:28 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by xXziroXx View Post
PHP Code:
if (this.string.starts("an")) { ... } 
Not that, I mean, if you have a clean text string, like:

PHP Code:
temp.text "item"
Now.. Is there a way to see if the string should have 'an' before it, or is the only way a public function?
__________________
Reply With Quote
  #4  
Old 01-05-2007, 08:38 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Chompy View Post
Not that, I mean, if you have a clean text string, like:

PHP Code:
temp.text "item"
Now.. Is there a way to see if the string should have 'an' before it, or is the only way a public function?
Ohh you mean like that.. no idea.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #5  
Old 01-05-2007, 08:43 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
There is no tell-tale way to determine this. Your script will not function perfectly. You will get results such as "a honor".
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #6  
Old 01-05-2007, 08:45 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Tolnaftate2004 View Post
There is no tell-tale way to determine this. Your script will not function perfectly. You will get results such as "a honor".
hmm, didn't think of that :O Would of been nice tho.. could maybe been scripted as a function.. hmm..
__________________
Reply With Quote
  #7  
Old 01-07-2007, 07:58 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
well you could create a very long 23 gigibyte english word base and do it from there :P Thats how large M-W webbase of common english words is.
__________________
Deep into the Darkness peering...
Reply With Quote
  #8  
Old 01-07-2007, 08:14 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Angel_Light View Post
well you could create a very long 23 gigibyte english word base and do it from there :P Thats how large M-W webbase of common english words is.
Gigabyte. I think it would be more check first letter for aeiou and then maybe an array of certain words which use an.
Reply With Quote
Reply


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


All times are GMT +2. The time now is 02:23 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.