A/An Converter #88


  • Enhancment
  • Replied
Open
Assigned to _ForgeUser8860360
  • _ForgeUser16132584 created this issue Jun 17, 2015

    So basically it is just a way to detect if a text should show a or an.

    Expression:

    send "%a or an of {_text}% %{_text}%" #Would show a or an depending on the next text.
    

    It would only work on texts (obviously). It would check the first letter of a text and if it is a, e, i, o, u, some times y.

    (Initial y is never treated as a vowel unless a consonant immediately follows it.)

    If it is a vowel, it would just set the expression to "an" or if it isn't, it would just be "a".

    This would be useful for items such as Apple and Diamond Sword would be come easier to use in a proper sentence.

    Problems I could see:

    • Player names would be changed to a or an.
    • Not sure what else.

    Mock up code: (Not sure how accurate it is for y. Don't mind the color codes. It was for testing.)

    command /aan [<text>]:
    	trigger:
    		if first character of arg-1 is "a" or "e" or "i" or "u":
    			broadcast "&5an %arg-1%"
    		else if first character of arg-1 is "y":
    			set {_s} to the first 2 characters of the text argument
    			set {_ycheck::*} to {_s} split at ""
    			loop {_ycheck::*}:
    				add 1 to {_num}
    				if {_num} is 2:
    					if loop-value is "a" or "e" or "i" or "u":
    						broadcast "&4a %arg-1%"
    					else:
    						broadcast "&3an %arg-1%"
    		else:
    			broadcast "&2a %arg-1%"
    

    Y: http://dictionary.reference.com/help/faq/language/g01.html

    Thanks, Nfell ;)

  • _ForgeUser16132584 added the tags New Enhancment Jun 17, 2015
  • _ForgeUser16132584 edited description Jun 17, 2015
  • _ForgeUser18811018 posted a comment Jun 17, 2015

    Also H with honor and some other words.

  • _ForgeUser8860360 posted a comment Jun 18, 2015

    This would require user input more than anything.

    an hour
    a user
    an FTP server
    all those don't follow the a/an rule.


    Edited Jun 18, 2015
  • _ForgeUser8860360 removed a tag New Jun 18, 2015
  • _ForgeUser8860360 added a tag Waiting Jun 18, 2015
  • _ForgeUser16132584 posted a comment Jun 18, 2015

    @Nfell2009: Go

    Alrighty. Guess I'll just have to manually do it.

  • _ForgeUser16132584 removed a tag Waiting Jun 18, 2015
  • _ForgeUser16132584 added a tag Replied Jun 18, 2015

To post a comment, please login or register a new account.