Guest User

Untitled

a guest
Dec 1st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 2.77 KB | None | 0 0
  1. :- module(emoticons, [
  2.               emoticon_english/2
  3.              ]).
  4.  
  5. emoticon_english(Emote, Eng) :-
  6.     atomic(Emote),
  7.     write_to_chars(Emote, EmoteCodes),
  8.     emoticon_english(EmoteCodes, Eng).
  9. emoticon_english(Emote, Eng) :-
  10.     with_output_to(codes(Eng), phrase(emote, Emote)).
  11.  
  12. emote --> "8cD",
  13.     {
  14.        format('Annie is her usual happy self\n', [])
  15.     }.
  16.  
  17. emote -->
  18.     part(hat, H),
  19.     part(eyebrows, Eb),
  20.     part(eyes, E),
  21.     part(nose, N),
  22.     part(mouth, M),
  23.     {
  24.        format('~s ~s ~s ~s ~s~n', [H,Eb,E,N,M])
  25.     }.
  26.  
  27. emote --> ...,
  28.     {
  29.      format('darned if I know, half the time they confuse me too~n', [])
  30.     }.
  31.  
  32. ... --> [].
  33. ... --> [_], ... .
  34.  
  35. part(Type, Say) -->
  36.     {
  37.        meaning(Type, X, Say)
  38.     },
  39.     X.
  40.  
  41. meaning(hat, "", "").
  42. meaning(hat, "d", "baseball cap worn sideways, or hat in general").
  43. meaning(hat, "&", "brain (brainy, or fried), or hair").
  44. meaning(hat, ")&$#|", "Carmen Miranda Hat").
  45. meaning(hat, "<", "Dunce cap, pointed head, or thinking cap").
  46. meaning(hat, ">", "Antenna").
  47. meaning(hat, "=", "hair standing on end").
  48. meaning(hat, "", "").
  49. meaning(eyebrows, ">", "inner eyebrows down, expressing worry or consternation").
  50. meaning(eyebrows, "|", "eyebrows corrugated, expressing sternness").
  51. meaning(eyebrows, "", "").
  52. meaning(eyes, "8", "").
  53. meaning(eyes, "B", "sunglasses").
  54. meaning(eyes, ":", "beady eyes").
  55. meaning(eyes, "X", "eyes closed or covered, in grief, disbelief, or pain").
  56. meaning(eyes, "o", "I'm a cyclops").
  57. meaning(eyes, "88", "wearing glasses").
  58. meaning(eyes, ";", "winking").
  59. meaning(nose, "c", "").
  60. meaning(nose, "C", "big nose").
  61. meaning(nose, "c:", "button nose").
  62. meaning(nose, [X], "non annie nose, reference to others") :-
  63.     member(X, "2^o-uUOvV>").
  64. meaning(mouth, "*", "kissing").
  65. meaning(mouth, "+", "puckered mouth").
  66. meaning(mouth, "(", "sad").
  67. meaning(mouth, ")", "happy, smile").
  68. meaning(mouth, "E", "toothy (maybe gap tooth dumb)").
  69. meaning(mouth, "o", "o mouth, suprise or shock").
  70. meaning(mouth, "O", "mouth agape, shock").
  71. meaning(mouth, "[", "stern or painful grimace").
  72. meaning(mouth, "]", "trying not to laugh, or smile").
  73. meaning(mouth, "|", "closed mouth look").
  74. meaning(mouth, "S", "discomfort, pain").
  75. meaning(mouth, "d", "tongue hanging out (delicious, distaste, or concentration)").
  76. meaning(mouth, "D", "Very happy - or default").
  77. meaning(mouth, "F", "Vampire fangs").
  78. meaning(mouth, "7", "variant mouth").
  79. meaning(mouth, "X", "puckered mouth - pain, good grief, or ouch").
  80. meaning(mouth, "C", "sticking out lower lip").
  81. meaning(mouth, ">", "variant smile").
  82. meaning(mouth, "?", "puzzlement, empathy, or concern").
  83. meaning(mouth, "p", "tongue hanging out (delicious, distaste, or concentration)").
  84. meaning(mouth, "P", "tongue hanging out (delicious, distaste, or concentration)").
  85. meaning(mouth, [X], "irony") :-
  86.     member(X, "/\\").
Add Comment
Please, Sign In to add comment