![]() |
[Annoyance] Correct Grammar - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51) +----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44) +------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13) +------ Thread: [Annoyance] Correct Grammar (/showthread.php?tid=2993) |
[Annoyance] Correct Grammar - Robin - 31-07-2009 Function which automatically checks the first letter of what's fed into it. Will see if it's correct to use 'An' or 'A'. Supports capitalisation and proper nouns. If the item, npc etc. has $ as the first character of it's name, it'll be read as a proper noun. Of course, you'll have to remove this when rendering item names and stuff on the map. Code: Public Function CheckGrammar(ByVal Word As String, Optional ByVal Caps As Byte = NO) As String Example: Code: msg = "You picked up " & CheckGrammar(Trim(Item(GetPlayerInvItemNum(index, n)).Name)) & "." Re: [Annoyance] Correct Grammar - Robin - 31-07-2009 DFA Wrote:its fail It's for nouns only you fucking retard. Re: [Annoyance] Correct Grammar - JokeofWeek - 31-07-2009 Just for the fun of it, since we're fixing grammar mistakes. I before E except after C Code: Dim Loc As Integer (I know there are exceptions, but eh ![]() Btw Robin, hourglass is a noun, but it's one of the few exceptions that use an that doesn't start by a vowel. Re: [Annoyance] Correct Grammar - Robin - 31-07-2009 [quote="JokeofWeek"]Btw Robin, hourglass is a noun, but it's one of the few exceptions that use an that doesn't start by a vowel. Re: [Annoyance] Correct Grammar - GIAKEN - 31-07-2009 Pfft I already did this. Re: [Annoyance] Correct Grammar - Robin - 31-07-2009 GIAKEN Wrote:Pfft I already did this. Holy fucking shit you're alive. Re: [Annoyance] Correct Grammar - Matt - 31-07-2009 If it sounds like it starts with a vowel, it's possed to use an, not a. I used to know a LOT of those words, but I can't remember them anymore. Lol. This is something that's been needed in MS for awhile. It seems like it's simple and would have no real change, but it makes a big difference imo. Re: [Annoyance] Correct Grammar - GIAKEN - 01-08-2009 Robin Wrote:GIAKEN Wrote:Pfft I already did this. I just moved out of my parents house. Anyways, I did this check grammar thing in Elysium Diamond 3 a long ass time ago. Here's my function: Code: Public Function CheckGrammar(ByVal Word As String, Optional ByVal Caps As Byte = NO) As String Re: [Annoyance] Correct Grammar - GIAKEN - 01-08-2009 Oh haha I see what you did thar Robin. Anybody notice how much alike they are? ![]() Re: [Annoyance] Correct Grammar - Robin - 01-08-2009 GIAKEN Wrote:Oh haha I see what you did thar Robin. Anybody notice how much alike they are? Probably your code. I just found it in Essence. Re: [Annoyance] Correct Grammar - Jacob - 01-08-2009 Here's a tiny improvement: using "ass" Quote:%Faster 185.7| 71.4| 71.4| 64.3| 71.4| 64.3| 71.4| 64.3| 84.6| 71.4 using "test" Quote:%Faster 46.7| 46.7| 64.3| 53.3| 53.3| 33.3| 33.3| 33.3| 53.3| 33.3 Test1 was using the original code. Test2 is: Code: Private Function CheckGrammar(ByVal Word As String, Optional ByVal Caps As Byte = 0) As String Re: [Annoyance] Correct Grammar - GIAKEN - 01-08-2009 Something less repetitive. Not sure if it's any faster. Also this function is made to be faster for words that need "An" because statements in an Else are always slower than statements in the actual If. I'm not sure which would come up more often (needing an An or just A), but to change it just add If Not FirstLetter and switched the statements around. Code: Private Function CheckGrammar(ByVal Word As String, Optional ByVal Caps As Byte = 0) As String |