Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   a or an (https://forums.graalonline.com/forums/showthread.php?t=71259)

Chompy 01-05-2007 08:21 PM

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..)

xXziroXx 01-05-2007 08:25 PM

PHP Code:

if (this.string.starts("an")) { ... } 


Chompy 01-05-2007 08:28 PM

Quote:

Originally Posted by xXziroXx (Post 1261361)
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?

xXziroXx 01-05-2007 08:38 PM

Quote:

Originally Posted by Chompy (Post 1261365)
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.

Tolnaftate2004 01-05-2007 08:43 PM

There is no tell-tale way to determine this. Your script will not function perfectly. You will get results such as "a honor".

Chompy 01-05-2007 08:45 PM

Quote:

Originally Posted by Tolnaftate2004 (Post 1261383)
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..

Angel_Light 01-07-2007 07:58 AM

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.

Twinny 01-07-2007 08:14 AM

Quote:

Originally Posted by Angel_Light (Post 1262151)
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.


All times are GMT +2. The time now is 09:05 AM.

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