text:
Build an English word syllable counter
Write a program or function to estimate as closely as possible the number of syllables in English words.
The input list is here: 1000 basic English words. There are only 997 words because a few duplicates were removed.
For each word, output a line containing the word, a comma (,), and the number of syllables and no other characters except for new-line, e.g. photograph,3 (pho-to-graph). Use the code snippet below to score your answer. Paste your code and output into the respective boxes and press the "Submit" button.
Scoring
All scoring is calculated automatically by the snippet, but here is how it works in order to lower your score:

60 points for each byte, however if you don't use any Unicode codepoints above U+00FF the snippet will calculate characters instead of bytes
Each word where the number of syllables is correct will score 0

Scoring table for wrong syllables. The axes are symmetrical, one is the number of wrong syllables per word, and the other is the number of words with that number of syllables wrong:
 | 1| 2| 3| 4| …
-+--+--+--+--+--
1| 1| 3| 6|10|
-+--+--+--+--+--
2| 3| 9|18|30|
-+--+--+--+--+--
3| 6|18|36|60|
-+--+--+--+--+--
4|10|30|60|100
-+--+--+--+--+--
…|  |  |  |  |

If you have 200 words with 1 wrong syllable and 100 words with 2 wrong syllables your score for wrong syllables will be 200*201/2 * 1*2/2 + 100*101/2 * 2*3/2 = 20100 * 1 + 5050 * 3 = 20100 + 15150 = 35250
The scoring is designed to make it easy to lower your score when you have a lot of wrong syllables but hard when you only have a few
Duplicate words in your output will not be removed. Outputting photograph,1, photograph,2, photograph,3 will simply increase your score
Post all three scores, Code, Word and Total. The Total Score will be used to determine a winner

You can use the code snippet to see how many syllables are expected for each word. Simply run it with no input and it will output the list in the expected format, as well as all the words where the number of syllables is wrong, e.g. photograph *1, (3).

var syl = {
  "a": 1,
  "about": 2,
  "above": 2,
  "across": 2,
  "act": 1,
  "active": 2,
  "activity": 4,
  "add": 1,
  "afraid": 2,
  "after": 2,
  "again": 2,
  "age": 1,
  "ago": 2,
  "agree": 2,
  "air": 1,
  "all": 1,
  "alone": 2,
  "along": 2,
  "already": 3,
  "always": 2,
  "am": 1,
  "amount": 2,
  "an": 1,
  "and": 1,
  "angry": 2,
  "another": 3,
  "answer": 2,
  "any": 2,
  "anyone": 3,
  "anything": 3,
  "anytime": 3,
  "appear": 3,
  "apple": 2,
  "are": 1,
  "area": 3,
  "arm": 1,
  "army": 2,
  "around": 2,
  "arrive": 2,
  "art": 1,
  "as": 1,
  "ask": 1,
  "at": 1,
  "attack": 2,
  "aunt": 1,
  "autumn": 2,
  "away": 2,
  "baby": 2,
  "back": 1,
  "bad": 1,
  "bag": 1,
  "ball": 1,
  "bank": 1,
  "base": 1,
  "basket": 2,
  "bath": 1,
  "be": 1,
  "bean": 1,
  "bear": 1,
  "beautiful": 3,
  "bed": 1,
  "bedroom": 2,
  "beer": 2,
  "before": 2,
  "begin": 2,
  "behave": 2,
  "behind": 2,
  "bell": 1,
  "below": 2,
  "besides": 2,
  "best": 1,
  "better": 2,
  "between": 2,
  "big": 1,
  "bird": 1,
  "birth": 1,
  "birthday": 2,
  "bit": 1,
  "bite": 1,
  "black": 1,
  "bleed": 1,
  "block": 1,
  "blood": 1,
  "blow": 1,
  "blue": 1,
  "board": 1,
  "boat": 1,
  "body": 2,
  "boil": 2,
  "bone": 1,
  "book": 1,
  "border": 2,
  "born": 1,
  "borrow": 2,
  "both": 1,
  "bottle": 2,
  "bottom": 2,
  "bowl": 1,
  "box": 1,
  "boy": 1,
  "branch": 1,
  "brave": 1,
  "bread": 1,
  "break": 1,
  "breakfast": 2,
  "breathe": 1,
  "bridge": 1,
  "bright": 1,
  "bring": 1,
  "brother": 2,
  "brown": 1,
  "brush": 1,
  "build": 1,
  "burn": 1,
  "bus": 1,
  "business": 2,
  "busy": 2,
  "but": 1,
  "buy": 1,
  "by": 1,
  "cake": 1,
  "call": 1,
  "can": 1,
  "candle": 2,
  "cap": 1,
  "car": 1,
  "card": 1,
  "care": 1,
  "careful": 2,
  "careless": 2,
  "carry": 2,
  "case": 1,
  "cat": 1,
  "catch": 1,
  "central": 2,
  "century": 3,
  "certain": 2,
  "chair": 1,
  "chance": 1,
  "change": 1,
  "chase": 1,
  "cheap": 1,
  "cheese": 1,
  "chicken": 2,
  "child": 1,
  "children": 2,
  "chocolate": 2,
  "choice": 1,
  "choose": 1,
  "circle": 2,
  "city": 2,
  "class": 1,
  "clean": 1,
  "clear": 2,
  "clever": 2,
  "climb": 1,
  "clock": 1,
  "close": 1,
  "cloth": 1,
  "clothes": 1,
  "cloud": 1,
  "cloudy": 2,
  "coat": 1,
  "coffee": 2,
  "coin": 1,
  "cold": 1,
  "collect": 2,
  "colour": 2,
  "comb": 1,
  "come": 1,
  "comfortable": 3,
  "common": 2,
  "compare": 2,
  "complete": 2,
  "computer": 3,
  "condition": 3,
  "contain": 2,
  "continue": 3,
  "control": 2,
  "cook": 1,
  "cool": 1,
  "copper": 2,
  "corn": 1,
  "corner": 2,
  "correct": 2,
  "cost": 1,
  "count": 1,
  "country": 2,
  "course": 1,
  "cover": 2,
  "crash": 1,
  "cross": 1,
  "cry": 1,
  "cup": 1,
  "cupboard": 2,
  "cut": 1,
  "dance": 1,
  "dangerous": 3,
  "dark": 1,
  "daughter": 2,
  "day": 1,
  "dead": 1,
  "decide": 2,
  "decrease": 2,
  "deep": 1,
  "deer": 2,
  "depend": 2,
  "desk": 1,
  "destroy": 2,
  "develop": 3,
  "die": 1,
  "different": 2,
  "difficult": 3,
  "dinner": 2,
  "direction": 3,
  "dirty": 2,
  "discover": 3,
  "dish": 1,
  "do": 1,
  "dog": 1,
  "door": 1,
  "double": 2,
  "down": 1,
  "draw": 1,
  "dream": 1,
  "dress": 1,
  "drink": 1,
  "drive": 1,
  "drop": 1,
  "dry": 1,
  "duck": 1,
  "dust": 1,
  "duty": 2,
  "each": 1,
  "ear": 2,
  "early": 2,
  "earn": 1,
  "earth": 1,
  "east": 1,
  "easy": 2,
  "eat": 1,
  "education": 4,
  "effect": 2,
  "egg": 1,
  "eight": 1,
  "either": 2,
  "electric": 3,
  "elephant": 3,
  "else": 1,
  "empty": 2,
  "end": 1,
  "enemy": 3,
  "enjoy": 2,
  "enough": 2,
  "enter": 2,
  "entrance": 2,
  "equal": 2,
  "escape": 2,
  "even": 2,
  "evening": 2,
  "event": 2,
  "ever": 2,
  "every": 2,
  "everybody": 4,
  "everyone": 3,
  "exact": 2,
  "examination": 5,
  "example": 3,
  "except": 2,
  "excited": 3,
  "exercise": 3,
  "expect": 2,
  "expensive": 3,
  "explain": 2,
  "extremely": 3,
  "eye": 1,
  "face": 1,
  "fact": 1,
  "fail": 2,
  "fall": 1,
  "false": 1,
  "family": 2,
  "famous": 2,
  "far": 1,
  "farm": 1,
  "fast": 1,
  "fat": 1,
  "father": 2,
  "fault": 1,
  "fear": 2,
  "feed": 1,
  "feel": 2,
  "female": 3,
  "fever": 2,
  "few": 1,
  "fight": 1,
  "fill": 1,
  "film": 1,
  "find": 1,
  "fine": 1,
  "finger": 2,
  "finish": 2,
  "fire": 2,
  "first": 1,
  "fit": 1,
  "five": 1,
  "fix": 1,
  "flag": 1,
  "flat": 1,
  "float": 1,
  "floor": 1,
  "flour": 2,
  "flower": 2,
  "fly": 1,
  "fold": 1,
  "food": 1,
  "fool": 1,
  "foot": 1,
  "football": 2,
  "for": 1,
  "force": 1,
  "foreign": 2,
  "forest": 2,
  "forget": 2,
  "forgive": 2,
  "fork": 1,
  "form": 1,
  "four": 1,
  "fox": 1,
  "free": 1,
  "freedom": 2,
  "freeze": 1,
  "fresh": 1,
  "friend": 1,
  "friendly": 2,
  "from": 1,
  "front": 1,
  "fruit": 1,
  "full": 1,
  "fun": 1,
  "funny": 2,
  "furniture": 3,
  "further": 2,
  "future": 2,
  "game": 1,
  "garden": 2,
  "gate": 1,
  "general": 2,
  "gentleman": 3,
  "get": 1,
  "gift": 1,
  "give": 1,
  "glad": 1,
  "glass": 1,
  "go": 1,
  "goat": 1,
  "god": 1,
  "gold": 1,
  "good": 1,
  "goodbye": 2,
  "grandfather": 3,
  "grandmother": 3,
  "grass": 1,
  "grave": 1,
  "great": 1,
  "green": 1,
  "grey": 1,
  "ground": 1,
  "group": 1,
  "grow": 1,
  "gun": 1,
  "hair": 1,
  "half": 1,
  "hall": 1,
  "hammer": 2,
  "hand": 1,
  "happen": 2,
  "happy": 2,
  "hard": 1,
  "hat": 1,
  "hate": 1,
  "have": 1,
  "he": 1,
  "head": 1,
  "healthy": 2,
  "hear": 2,
  "heart": 1,
  "heaven": 2,
  "heavy": 2,
  "height": 1,
  "hello": 2,
  "help": 1,
  "hen": 1,
  "her": 1,
  "here": 2,
  "hers": 1,
  "hide": 1,
  "high": 1,
  "hill": 1,
  "him": 1,
  "his": 1,
  "hit": 1,
  "hobby": 2,
  "hold": 1,
  "hole": 1,
  "holiday": 3,
  "home": 1,
  "hope": 1,
  "horse": 1,
  "hospital": 3,
  "hot": 1,
  "hotel": 2,
  "hour": 2,
  "house": 1,
  "how": 1,
  "hundred": 2,
  "hungry": 2,
  "hurry": 2,
  "hurt": 1,
  "husband": 2,
  "I": 1,
  "ice": 1,
  "idea": 3,
  "if": 1,
  "important": 3,
  "in": 1,
  "increase": 2,
  "inside": 2,
  "into": 2,
  "introduce": 3,
  "invent": 2,
  "invite": 2,
  "iron": 2,
  "is": 1,
  "island": 2,
  "it": 1,
  "its": 1,
  "jelly": 2,
  "job": 1,
  "join": 1,
  "juice": 1,
  "jump": 1,
  "just": 1,
  "keep": 1,
  "key": 1,
  "kill": 1,
  "kind": 1,
  "king": 1,
  "kitchen": 2,
  "knee": 1,
  "knife": 1,
  "knock": 1,
  "know": 1,
  "ladder": 2,
  "lady": 2,
  "lamp": 1,
  "land": 1,
  "large": 1,
  "last": 1,
  "late": 1,
  "lately": 2,
  "laugh": 1,
  "lazy": 2,
  "lead": 1,
  "leaf": 1,
  "learn": 1,
  "leave": 1,
  "left": 1,
  "leg": 1,
  "lend": 1,
  "length": 1,
  "less": 1,
  "lesson": 2,
  "let": 1,
  "letter": 2,
  "library": 2,
  "lie": 1,
  "life": 1,
  "light": 1,
  "like": 1,
  "lion": 2,
  "lip": 1,
  "list": 1,
  "listen": 2,
  "little": 2,
  "live": 1,
  "lock": 1,
  "lonely": 2,
  "long": 1,
  "look": 1,
  "lose": 1,
  "lot": 1,
  "love": 1,
  "low": 1,
  "lower": 2,
  "luck": 1,
  "machine": 2,
  "main": 1,
  "make": 1,
  "male": 2,
  "man": 1,
  "many": 2,
  "map": 1,
  "mark": 1,
  "market": 2,
  "marry": 2,
  "matter": 2,
  "may": 1,
  "me": 1,
  "meal": 2,
  "mean": 1,
  "measure": 2,
  "meat": 1,
  "medicine": 3,
  "meet": 1,
  "member": 2,
  "mention": 2,
  "method": 2,
  "middle": 2,
  "milk": 1,
  "million": 2,
  "mind": 1,
  "minute": 2,
  "miss": 1,
  "mistake": 2,
  "mix": 1,
  "model": 2,
  "modern": 2,
  "moment": 2,
  "money": 2,
  "monkey": 2,
  "month": 1,
  "moon": 1,
  "more": 1,
  "morning": 2,
  "most": 1,
  "mother": 2,
  "mountain": 2,
  "mouth": 1,
  "move": 1,
  "much": 1,
  "music": 2,
  "must": 1,
  "my": 1,
  "name": 1,
  "narrow": 2,
  "nation": 2,
  "nature": 2,
  "near": 2,
  "nearly": 2,
  "neck": 1,
  "need": 1,
  "needle": 2,
  "neighbour": 2,
  "neither": 2,
  "net": 1,
  "never": 2,
  "new": 1,
  "news": 1,
  "newspaper": 3,
  "next": 1,
  "nice": 1,
  "night": 1,
  "nine": 1,
  "no": 1,
  "noble": 2,
  "noise": 1,
  "none": 1,
  "nor": 1,
  "north": 1,
  "nose": 1,
  "not": 1,
  "nothing": 2,
  "notice": 2,
  "now": 1,
  "number": 2,
  "obey": 2,
  "object": 2,
  "ocean": 2,
  "of": 1,
  "off": 1,
  "offer": 2,
  "office": 2,
  "often": 2,
  "oil": 2,
  "old": 1,
  "on": 1,
  "one": 1,
  "only": 2,
  "open": 2,
  "opposite": 3,
  "or": 1,
  "orange": 2,
  "order": 2,
  "other": 2,
  "our": 2,
  "out": 1,
  "outside": 2,
  "over": 2,
  "own": 1,
  "page": 1,
  "pain": 1,
  "paint": 1,
  "pair": 1,
  "pan": 1,
  "paper": 2,
  "parent": 2,
  "park": 1,
  "part": 1,
  "partner": 2,
  "party": 2,
  "pass": 1,
  "past": 1,
  "path": 1,
  "pay": 1,
  "peace": 1,
  "pen": 1,
  "pencil": 2,
  "people": 2,
  "pepper": 2,
  "per": 1,
  "perfect": 2,
  "period": 3,
  "person": 2,
  "petrol": 2,
  "photograph": 3,
  "piano": 3,
  "pick": 1,
  "picture": 2,
  "piece": 1,
  "pig": 1,
  "pin": 1,
  "pink": 1,
  "place": 1,
  "plane": 1,
  "plant": 1,
  "plastic": 2,
  "plate": 1,
  "play": 1,
  "please": 1,
  "pleased": 1,
  "plenty": 2,
  "pocket": 2,
  "point": 1,
  "poison": 2,
  "police": 1,
  "polite": 2,
  "pool": 1,
  "poor": 1,
  "popular": 3,
  "position": 3,
  "possible": 3,
  "potato": 3,
  "pour": 1,
  "power": 2,
  "present": 2,
  "press": 1,
  "pretty": 2,
  "prevent": 2,
  "price": 1,
  "prince": 1,
  "prison": 2,
  "private": 2,
  "prize": 1,
  "probably": 3,
  "problem": 2,
  "produce": 2,
  "promise": 2,
  "proper": 2,
  "protect": 2,
  "provide": 2,
  "public": 2,
  "pull": 1,
  "punish": 2,
  "pupil": 2,
  "push": 1,
  "put": 1,
  "queen": 1,
  "question": 2,
  "quick": 1,
  "quiet": 2,
  "quite": 1,
  "radio": 3,
  "rain": 1,
  "rainy": 2,
  "raise": 1,
  "reach": 1,
  "read": 1,
  "ready": 2,
  "real": 2,
  "really": 2,
  "receive": 2,
  "record": 2,
  "red": 1,
  "remember": 3,
  "remind": 2,
  "remove": 2,
  "rent": 1,
  "repair": 2,
  "repeat": 2,
  "reply": 2,
  "report": 2,
  "rest": 1,
  "restaurant": 2,
  "result": 2,
  "return": 2,
  "rice": 1,
  "rich": 1,
  "ride": 1,
  "right": 1,
  "ring": 1,
  "rise": 1,
  "road": 1,
  "rob": 1,
  "rock": 1,
  "room": 1,
  "round": 1,
  "rubber": 2,
  "rude": 1,
  "rule": 1,
  "ruler": 2,
  "run": 1,
  "rush": 1,
  "sad": 1,
  "safe": 1,
  "sail": 2,
  "salt": 1,
  "same": 1,
  "sand": 1,
  "save": 1,
  "say": 1,
  "school": 1,
  "science": 2,
  "scissors": 2,
  "search": 1,
  "seat": 1,
  "second": 2,
  "see": 1,
  "seem": 1,
  "sell": 1,
  "send": 1,
  "sentence": 2,
  "serve": 1,
  "seven": 2,
  "several": 2,
  "sex": 1,
  "shade": 1,
  "shadow": 2,
  "shake": 1,
  "shape": 1,
  "share": 1,
  "sharp": 1,
  "she": 1,
  "sheep": 1,
  "sheet": 1,
  "shelf": 1,
  "shine": 1,
  "ship": 1,
  "shirt": 1,
  "shoe": 1,
  "shoot": 1,
  "shop": 1,
  "short": 1,
  "should": 1,
  "shoulder": 2,
  "shout": 1,
  "show": 1,
  "sick": 1,
  "side": 1,
  "signal": 2,
  "silence": 2,
  "silly": 2,
  "silver": 2,
  "similar": 3,
  "simple": 2,
  "since": 1,
  "sing": 1,
  "single": 2,
  "sink": 1,
  "sister": 2,
  "sit": 1,
  "six": 1,
  "size": 1,
  "skill": 1,
  "skin": 1,
  "skirt": 1,
  "sky": 1,
  "sleep": 1,
  "slip": 1,
  "slow": 1,
  "small": 1,
  "smell": 1,
  "smile": 2,
  "smoke": 1,
  "snow": 1,
  "so": 1,
  "soap": 1,
  "sock": 1,
  "soft": 1,
  "some": 1,
  "someone": 2,
  "something": 2,
  "sometimes": 2,
  "son": 1,
  "soon": 1,
  "sorry": 2,
  "sound": 1,
  "soup": 1,
  "south": 1,
  "space": 1,
  "speak": 1,
  "special": 2,
  "speed": 1,
  "spell": 1,
  "spend": 1,
  "spoon": 1,
  "sport": 1,
  "spread": 1,
  "spring": 1,
  "square": 1,
  "stamp": 1,
  "stand": 1,
  "star": 1,
  "start": 1,
  "station": 2,
  "stay": 1,
  "steal": 2,
  "steam": 1,
  "step": 1,
  "still": 1,
  "stomach": 1,
  "stone": 1,
  "stop": 1,
  "store": 1,
  "storm": 1,
  "story": 2,
  "strange": 1,
  "street": 1,
  "strong": 1,
  "structure": 2,
  "student": 2,
  "study": 2,
  "stupid": 2,
  "subject": 2,
  "substance": 2,
  "successful": 3,
  "such": 1,
  "sudden": 2,
  "sugar": 2,
  "suitable": 3,
  "summer": 2,
  "sun": 1,
  "sunny": 2,
  "support": 2,
  "sure": 1,
  "surprise": 2,
  "sweet": 1,
  "swim": 1,
  "sword": 1,
  "table": 2,
  "take": 1,
  "talk": 1,
  "tall": 1,
  "taste": 1,
  "taxi": 2,
  "tea": 1,
  "teach": 1,
  "team": 1,
  "tear": [1, 2],
  "telephone": 3,
  "television": 4,
  "tell": 1,
  "ten": 1,
  "tennis": 2,
  "terrible": 3,
  "test": 1,
  "than": 1,
  "that": 1,
  "the": 1,
  "their": 1,
  "then": 1,
  "there": 1,
  "therefore": 2,
  "these": 1,
  "thick": 1,
  "thin": 1,
  "thing": 1,
  "think": 1,
  "third": 1,
  "this": 1,
  "though": 1,
  "threat": 1,
  "three": 1,
  "tidy": 2,
  "tie": 1,
  "title": 2,
  "to": 1,
  "today": 2,
  "toe": 1,
  "together": 3,
  "tomorrow": 3,
  "tonight": 2,
  "too": 1,
  "tool": 1,
  "tooth": 1,
  "top": 1,
  "total": 2,
  "touch": 1,
  "town": 1,
  "train": 1,
  "tram": 1,
  "travel": 2,
  "tree": 1,
  "trouble": 2,
  "true": 1,
  "trust": 1,
  "try": 1,
  "turn": 1,
  "twice": 1,
  "type": 1,
  "uncle": 2,
  "under": 2,
  "understand": 3,
  "unit": 2,
  "until": 2,
  "up": 1,
  "use": 1,
  "useful": 2,
  "usual": 2,
  "usually": 3,
  "vegetable": 3,
  "very": 2,
  "village": 2,
  "visit": 2,
  "voice": 1,
  "wait": 1,
  "wake": 1,
  "walk": 1,
  "want": 1,
  "warm": 1,
  "wash": 1,
  "waste": 1,
  "watch": 1,
  "water": 2,
  "way": 1,
  "we": 1,
  "weak": 1,
  "wear": 1,
  "weather": 2,
  "wedding": 2,
  "week": 1,
  "weight": 1,
  "welcome": 2,
  "well": 1,
  "west": 1,
  "wet": 1,
  "what": 1,
  "wheel": 2,
  "when": 1,
  "where": 1,
  "which": 1,
  "while": 2,
  "white": 1,
  "who": 1,
  "why": 1,
  "wide": 1,
  "wife": 1,
  "wild": 2,
  "will": 1,
  "win": 1,
  "wind": 1,
  "window": 2,
  "wine": 1,
  "winter": 2,
  "wire": 2,
  "wise": 1,
  "wish": 1,
  "with": 1,
  "without": 2,
  "woman": 2,
  "wonder": 2,
  "word": 1,
  "work": 1,
  "world": 1,
  "worry": 2,
  "worst": 1,
  "write": 1,
  "wrong": 1,
  "year": 2,
  "yes": 1,
  "yesterday": 3,
  "yet": 1,
  "you": 1,
  "young": 1,
  "your": 1,
  "zero": 2,
  "zoo": 1
};

function checkcode(e) {
  var t = document.getElementById('words').value;
  var re = new RegExp(/^(\w+),(\d+)/gm);
  var lines = t.match(re);
  re = new RegExp(/^(\w+),(\d+)/);
  if (!lines) {
    lines = [];
  }
  var keys = JSON.parse(JSON.stringify(syl));
  var tally = [];
  var wrong = [];
  for (i = 0; i < lines.length; ++i) {
    var num = lines[i].match(re);
    if (num[1] in syl) {
      var res = num[1] !== "tear"? Math.abs(syl[num[1]] - num[2]): Math.min(Math.abs(syl[num[1]][0] - num[2]), Math.abs(syl[num[1]][1] - num[2]));
      if (!(res in tally)) {
        tally[res] = 0;
      }
      ++tally[res];
      if (res) {
        wrong.push(num[1] + " *" + num[2] + ", (" + syl[num[1]] + ")");
      }
      delete(keys[num[1]]);
    }
  }
  for (i in keys) {
    if (!(keys[i] in tally)) {
      tally[keys[i]] = 0;
    }
    ++tally[keys[i]];
  }
  var score = 0;
  for (i = 0; i < tally.length; ++i) {
    if (i in tally) {
      score += i * (i + 1) * tally[i] * (tally[i] + 1) / 4;
    }
  }
  var missing = 0;
  var missinglist = []
  for (i in keys) {
    missinglist.push(i + "," + keys[i]);
    ++missing;
  }
  codescore = document.getElementById("code").value.length;
  codescore = document.getElementById("code").value;
  if (codescore.match(/[^\u0000-\u00FF]/)) {
    cs1 = codescore.match(/[\u0000-\u007F]/g);
    cs2 = codescore.match(/[\u0080-\u07FF]/g);
    cs3 = codescore.match(/[\u0800-\uFFFF]/g);
    codescore = (cs1? cs1.length: 0) + (cs2? cs2.length * 2: 0) + (cs3? cs3.length * 3: 0);
  }
  else {
    codescore = codescore.length;
  }
  codescore *= 60;
  document.getElementById("result").value = "Code score: " + codescore + "\nWord score: " + score + "\nTotal score: " + (codescore + score) + "\nValid lines: " + lines.length + "\nMissing words: " + missing + "\n\nMissing words:\n" + missinglist.join("\n") + "\n\nWrong number:\n" + wrong.join("\n");
}
textarea {
        width: 320px;
        height: 480px;
      }

      textarea#code {
        width: 650px;
        height: 80px;
      }

      span {
        display: inline-block;
      }
Code:

    <textarea id="code">
</textarea>

    Output:

    <textarea id="words">
</textarea>
    Score:
<textarea id="result" disabled="disabled">
</textarea>

    <input type="submit" onclick="checkcode(this)"/>

The variant of English used for the syllables is Australian English, spoken slower than usual. There is one word in the list that has two pronunciations with different numbers of syllables: tear to rip, 1 syllable; and water from the eye, 2 syllables (te-ar). Either tear,1 or tear,2 is correct for this word. I have gone through the whole list twice, but there might be some errors. Please don't complain that a particular word has a different number of syllables in British, American, etc. English. I will only make changes to the expected number of syllables if I agree that the number of syllables is wrong in Australian English.
Standard Code Golf rules with custom scoring.

Should the function just take the word as input an output the number of syllables?

@LegionMammal978 I have provided a few examples of the output lines such as photograph,3, plus running the snippet with no input also shows the expected output in the correct format.

I know, but what should our programs output? Adding support for the word,number format would nearly double my code length, as opposed to just outputting the number.

@LegionMammal978 If you just output the number there's no way for the snippet to know which was the input word. If your language is PHP or Perl, writing print("$w,$n") instead of print($n) doesn't add that many characters. It's best to input the entire list to your program (e.g. as a file) and output the whole list too.

However, that adds many more bytes. It's the difference between programprogramprogram&, #<>","<>ToString[programprogramprogram]&, and Print[""<>(#<>","<>ToString[programprogramprogram]<>"\n"&/@StringSplit[InputString[]~Import~"Text"])].

@LegionMammal978 Your program is already going to have to be fairly long to cut down on penalties for wrong syllables. A few bytes saved for not printing the word won't make much of a difference. Everyone has the same rules to follow, so you're not at a disadvantage.

Let us continue this discussion in chat.

Mathematica, score 4560 (code) + 1128 (words) = 5688 (total)
""<>({#,",",ToString@Length[#~WordData~"Hyphenation"],"
"}&/@StringSplit@#)&

Anonymous function. Uses Mathematica's built-in WordData. For reference, here are the incorrect words (some of which I disagree with):
appear *2, (3)
beer *1, (2)
boil *1, (2)
chocolate *3, (2)
clear *1, (2)
colour *1, (2)
comfortable *4, (3)
deer *1, (2)
different *3, (2)
ear *1, (2)
fail *1, (2)
family *3, (2)
fear *1, (2)
feel *1, (2)
female *2, (3)
fire *1, (2)
flour *1, (2)
general *3, (2)
hear *1, (2)
here *1, (2)
hour *1, (2)
library *3, (2)
male *1, (2)
meal *1, (2)
near *1, (2)
oil *1, (2)
our *1, (2)
over *1, (2)
petrol *1, (2)
piano *2, (3)
police *2, (1)
really *3, (2)
restaurant *3, (2)
sail *1, (2)
several *3, (2)
smile *1, (2)
steal *1, (2)
stomach *2, (1)
tidy *1, (2)
usual *3, (2)
usually *4, (3)
vegetable *4, (3)
wheel *1, (2)
while *1, (2)
wild *1, (2)
wire *1, (2)
year *1, (2)

Ruby, 5160 code + 4008 words = 9168
->l{l.lines{|w|print w.chop,?,,w.sub("e\n","").tr_s('aeiouy','******').count('*'),$/}}

Anonymous function. Expects as an argument all the words in a single string, newline separated, (as direct from pastebin.) Requires a trailing newline in order to print zoo correctly (can be fixed for 1 byte if required.)
ungolfed
f=->l{                       #Lambda assigned to varible f. Call as f[list]
  l.lines{|w|                #for each line, complete with newline
    print w.chop,?,,         #print the word with the newline removed, and a comma, and the following:
    w.sub("e\n","").         #Take the word. If there is an (e and newline) at the end remove them
    tr_s('aeiouy','******'). #convert all vowel clusters to a single *
    count('*'),              #and count the stars
    $/                       #finally print a newline ($/ is a special variable holding the line separator, newline by default.)
  }
}

wrong words
About twice as many as Legionmamma's mathematica answer.
I've marked 3 common and easy to fix errors. Whether difference in code length is worth it is another matter. I might get back to this later.
anyone *2, (3)
appear *2, (3)
apple *1, (2)             #A consonant+le ending (19 incidences)
area *2, (3)
be *0, (1)                #B words must have at least one syllable (7 incidences)
beer *1, (2)
besides *3, (2)           #C es ending (3 incidences)
boil *1, (2)
bottle *1, (2)            #A
business *3, (2)
candle *1, (2)            #A
careful *3, (2)
careless *3, (2)
chocolate *3, (2)
circle *1, (2)            #A
clear *1, (2)
clothes *2, (1)           #C
deer *1, (2)
different *3, (2)
double *1, (2)            #A
ear *1, (2)
evening *3, (2)
every *3, (2)
everybody *5, (4)
example *2, (3)           #A
extremely *4, (3)
fail *1, (2)
family *3, (2)
fear *1, (2)
feel *1, (2)
female *2, (3)
fire *1, (2)
flour *1, (2)
general *3, (2)
he *0, (1)                #B
hear *1, (2)
here *1, (2)
hour *1, (2)
I *0, (1)                 #B
idea *2, (3)
lately *3, (2)
library *3, (2)
lion *1, (2)
little *1, (2)            #A
lonely *3, (2)
male *1, (2)
me *0, (1)                #B
meal *1, (2)
middle *1, (2)            #A
near *1, (2)
needle *1, (2)            #A
noble *1, (2)             #A
oil *1, (2)
our *1, (2)
people *1, (2)            #A
period *2, (3)
piano *2, (3)
pleased *2, (1)
police *2, (1)
possible *2, (3)
quiet *1, (2)
radio *2, (3)
real *1, (2)
restaurant *3, (2)
sail *1, (2)
science *1, (2)
several *3, (2)
she *0, (1)               #B
simple *1, (2)            #A
single *1, (2)            #A
smile *1, (2)
something *3, (2)
sometimes *4, (2)         #C
steal *1, (2)
stomach *2, (1)
suitable *2, (3)          #A
table *1, (2)             #A
terrible *2, (3)          #A
the *0, (1)               #B
therefore *3, (2)
title *1, (2)             #A
trouble *1, (2)           #A
uncle *1, (2)             #A
useful *3, (2)
we *0, (1)                #B
wheel *1, (2)
while *1, (2)
wild *1, (2)
wire *1, (2)
year *1, (2)


text:
Primitive Roots of Unity
Let z be a complex number. z is an nth primitive root of unity if for a certain positive integer n  and for any positive integer k < n .
Challenge
Write a full program or function that, given a positive integer n as input, outputs all of the nth primitive roots of unity. You may output them in polar form (e^θi or e^iθ, argument should be a decimal with at least 2 decimal places) or rectangular form (a + bi or a similar form, real and imaginary parts should also be decimals), and they may be outputted in your language's list/array format or as a string with the numbers separated by spaces or newlines. Built-ins that calculate the nth roots of unity or the nth primitive roots of unity are not allowed.
This is code-golf, so shortest code in bytes wins.
Sample Inputs and Outputs
6 -> e^1.05i, e^-1.05i # polar form
3 -> e^2.094395i, e^-2.094395i # any number of decimal places is OK as long as there are more than 2
8 -> 0.707 + 0.707i, 0.707 - 0.707i, -0.707 + 0.707i, -0.707 - 0.707i # rectangular form
1 -> 1 + 0i # this is OK
1 -> 1 # this is also OK
4 -> 0 + i, 0 - i # this is OK
4 -> i, -i # this is also OK

So +-i are not solution of z^8=1?

Jelly, 11 9 bytes
Thanks to @Dennis for -2 bytes!
Rg=1O÷H-*

I wanted to generate the numbers coprime to N by folding set difference over all of the roots of unity from 1 to N, but I couldn't figure out how so I used @Dennis's method.
Rg=1O÷H-*         Monadic chain:          6
R                 Range                   [1,2,3,4,5,6]
 g                Hook gcds with range    [1,2,3,2,1,6]
  =1              [gcds equal to one]     [1,0,0,0,1,0]
    O             Replicate indices       [1,5]
     ÷H           Divide by half of N     [1/3,5/3]
       -          Numeric literal: - by itself is -1.
        *         Take -1 to those powers [cis π/3,cis 5π/3]

Try it here. Valid in this version of Jelly, but may not be in versions after February 1, 2016.

Jelly, 14 bytes
Rg=1O°÷×ı360Æe

Try it online!
How it works
z = e2tπi is an nth root of 1 if and only if t = k / n for some integer k.
z is primitive if and only if k and n are coprime.
Rg=1O°÷×ı360Æe  Main link. Input: n

R               Yield [1, ..., n].
 g              Compute the GCDs of reach integer and n.
  =1            Compare the GCDs with 1.
    O           Get all indices of 1's.
                This computes all the list of all k in [1, ..., n]
                such that k and n are coprime.
     °          Convert the integers to radians.
      ÷         Divide the results by n.
       ×ı360    Multiply the quotient by the imaginary number 360i.
            Æe  Map exp over the results.

Julia, 48 bytes
n->cis(360deg2rad(filter(k->gcd(k,n)<2,1:n))/n)

This is a lambda function that accepts an integer and returns an array of complex floats. To call it, assign it to a variable. It uses the same approach as Dennis' Jelly answer.
Ungolfed:
function f(n::Int)
    # Get the set of all k < n : gcd(k,n) = 1
    K = filter(k -> gcd(k,n) < 2, 1:n)

    # Convert these to radian measures
    θ = deg2rad(K)

    # Multiply by 360, divide by n
    θ = 360 * θ / n

    # Compute e^iz for all elements z of θ
    return cis(θ)
end

MATL, 27 bytes
:1-tGYf1X-!\Xpg)2j*YP*G/Ze!

Uses release (9.3.1), which is earlier than this challenge.
Try it online!
(The online compiler uses a newer release, but the code runs in release 9.3.1 and gives the same result)
Explanation
There are three main steps:

Generate integers 0,1,...,N-1, corresponding to all roots.
Keep only integers corresponding to primitive roots. These are identified using the prime factor decomposition of N.
Generate the actual roots with an imaginary exponential.

Code:
:1-           % 1. Implicit input "N". Produce vector [0,1,...,N-1]
t             %    duplicate
GYf           % 2. Prime factors of N
1X-           %    remove factor "1" if present (only if N==1)
!\            %    all combinations of [0,1,...,N-1] modulo prime factors of N
Xpg           %    logical "and" along the prime-factor dimension
)             %    index into original vector [0,1,...,N-1] to keep only primitive roots
2j*YP*G/Ze    % 3. Imaginary exponential to produce those roots
!             %    transpose for better output format

Ruby, 46 bytes
This is a non-"golfing language" implementation of Thomas Kwa's Jelly answer.
->n{(1..n).map{|j|1i**(4.0*j/n)if j.gcd(n)<2}}

Ungolfed:
def r(n)
  (1..n).each do |j|
    if j.gcd(n) == 1    # if j is coprime with n, then this will be a primitive root of unity
      p 1i**(4.0*j/n)   # print the fourth power of i**(j/n), i.e. the root of unity
    end
  end
end

Matlab 49 bytes
n=input('');q=0:n-1;exp(i*2*pi/n.*q(gcd(n,q)==1))

Didn't get the task at the first time, but now here it is. Outputs as follows:
6
ans =
    0.5000 + 0.8660i   0.5000 - 0.8660i

Your answer displays all roots of unity, not just the primitive ones.

@flawr thanks for remark, I didn't get the task at first. I edited solution

ES6, 96 bytes
n=>[...Array(n).keys()].filter(i=>g(i,n)<2,g=(a,b)=>a?g(b%a,a):b).map(i=>'e^'+Math.PI*2*i/n+'i')

Polar form was the shortest output.

PARI/GP, 41 bytes
Pretty straightforward: find the numbers from 1 to n which are coprime to n, then
n->[exp(2*Pi*I*m/n)|m<-[1..n],gcd(n,m)<2]

There has to be some shorter way, but this was the best I could find.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Bézout's Identity
Introduction to Bézout's identity
The GCD of two integers A, B is the largest positive integer that divides both of them leaving no remainder. Now because of Euclid's property that each integer N can be divided by another integer M as follows:

there exist pairs u,v such that we can write:

Since there is an infinite amount of those pairs, we'd like to find special ones. There are in fact exactly (A,B not being zero) two such pairs that satify

e.g.

Challenge
The goal of this challenge is to find the (ordered) pair of coefficients (u,v) that satify the above constraints and where u must be positive. This narrows down the output to a unique pair.

Input
We may assume that the input is positive, also A will always be larger than B (A > B).

Output
The output of our program/function must be the (ordered) pair specified in the challenge.

Rules
One must not use built-in extended Euclidean algorithms (e.g. in Mathematica one is allowed to use GCD but not ExtendedGCD - which would fail for 5,3 anyways).
The answer may be a full program (taking input via STDIN or similar and output via STDOUT) or a function (returning the pair).
Beside the pair (u,v) there shall not be any output, trailing newlines or spaces are allowed. (brackets or commas are fine)
This is code golf, all standard loopholes are forbidden and the program with the lowest byte count wins.

Examples
(A, B) -> (u, v)
(42, 12) -> (1, -3)
(4096, 84) -> (4, -195)
(5, 3) -> (2, -3)
(1155, 405) -> (20, -57)
(37377, 5204) -> (4365, -31351)
(7792, 7743) -> (7585, -7633)
(38884, 2737) -> (1707, -24251)
(6839, 746) -> (561, -5143)
(41908, 7228) -> (1104, -6401)
(27998, 6461) -> (3, -13)
(23780, 177) -> (20, -2687)
(11235813, 112358) -> (8643, -864301)

Related.

MATL, 37 40 bytes
ZdXK2Gw/:1G*1GK/t_w2$:XI2G*!+K=2#fIb)

Uses release (9.3.1), which is earlier than this challenge.
This is a brute force approach, so it may not work for large inputs.
Try it online! The online compiler is based on a newer release, but produces the same results.
Explanation
Zd            % implicitly input A and B. Compute their GCD. Call that C
XK            % copy C to clipboard K
2Gw/:         % vector [1, 2, ..., B/C]
1G*           % multiply that vector by A
1GK/t_w2$:    % vector [-A/C, -A/C+1 ..., A/C]
XI            % copy to clipboard I
2G*           % multiply that vector by B
!+            % all pairwise sums of elements from those vectors
K=2#f         % find row and column indices of sum that equals C
Ib)           % index second vector with column (indexing first vector with
              % row is not needed, because that vector is of the form [1, 2, ...])

Haskell, 51 bytes
a#b=[(u,-v)|v<-[1..],u<-[1..v],gcd a b==u*a-v*b]!!0

Usage example: 27998 # 6461 -> (3,-13).
This is a brute force approach which finds all combinations of u and v that are valid solutions ordered by u and picks the first one. This takes some time to run for large |v|.

I love the []!!0 idea=)

Python 3, 101 106 bytes
Edit: Added some improvements and corrections suggested by Bruce_Forte.
An answer that uses the extended Euclidean algorithm. It's a bit clunky in places though, and I hope to golf it some more. I could convert to Python 2 to save a byte on integer division (//) but I'm not sure how Python 2's % modulus operator works with a negative second argument, as that is crucial for getting the output right.
def e(a,b):
 r=b;x=a;s=z=0;t=y=1
 while r:q=x/r;x,r=r,x%r;y,s=s,y-q*s;z,t=t,z-q*t
 return y%(b/x),z%(-a/x)

Ungolfed:
def e(a, b):
    r = b
    x = a    # becomes gcd(a, b)
    s = 0
    y = 1    # the coefficient of a
    t = 1
    z = 0    # the coefficient of b
    while r:
        q = x / r
        x, r = r, x % r
        y, s = s, y - q * s
        z, t = t, z - q * t
    return y % (b / x), z % (-a / x) # modulus in this way so that y is positive and z is negative

An anonymous user pointed out that the variable k in your ungolfed version's last line is undefined.

@JonathanFrech Ah, thank you!

Ruby, 83 bytes
I think there are a few ways to fine-tune and golf this solution, but I like it so far. Maybe I'll try an extended Euclidean algorithm solution next.
->x,y{a=b=0;y.downto(0).map{|u|(-x..0).map{|v|a,b=u,v if u*x+v*y==x.gcd(y)}};p a,b}

How it works
This code starts with a loop of u from y down to 0, with an inner loop of v from -x to 0, inside which we check every u and v if u*x+v*y == gcd(x, y). Since there could be multiple matches along the way (this uses a very exhaustive search), we start far from 0 so that when we get the last of the multiple matches, it's the one where |u| and |v| are closest to 0.
def bezout(x,y)
  a=b=0
  y.downto(0).each do |u|
    (-x..0).each do |v|
      if u*x + v*y == x.gcd(y)
        a,b=u,v
      end
    end
  end
  p a,b
end

@Bruce_Forte Darn. IRB ran out of memory for that test case. I'll write up an extended Euclidean algorithm solution as soon as I can.

Mathematica, 80 bytes
f@l_:=Mod@@NestWhile[{Last@#,{1,-Quotient@@(#.l)}.#}&,{{1,0},{0,1}},Last@#.l>0&]

Explanation:
Extended Euclidean algorithm is used here, in a Nest style. The method that the coefficients are stored in arrays makes it possible to use Dot.
Another possible representation is simply using symbolic expression, like u a - v b with {a->19, b->17}. Such representation makes use of the feature of Mathematica and is interesting, but it is much longer in bytes.

Test cases:
f[{5, 3}]              (* {2, -3} *)
f[{42, 12}]            (* {1, -3} *)
f[{11235813, 112358}]  (* {8643, -864301} *)

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Predict whether a message will be starred or not in 50 bytes
Given an input of a string consisting of any message from our site
chatroom taken
from the list described and linked below, output either a truthy or a falsy
value attempting to predict whether that message was starred or not in 50 bytes
or less.
You may use any truthy or falsy
values, but they must be
identical (i.e. there should only be two possible outputs, one truthy and one
falsy). The input will be given as raw HTML with newlines removed, and it may
contain non-ASCII Unicode characters. If you require input in something other
than UTF-8, please say so in your answer.
The winning submission to this challenge will be the one that predicts the
highest percentage of chat messages correctly, out of the list linked below. If
two given submissions have the same success rate, the shorter submission will
win.
Please provide instructions for running your code on the entire set of messages
and calculating the percentage correct. Ideally, this should be a bit of
boilerplate code (not counted towards your 50 bytes) that loops through the
positive test cases and outputs how many of them your code got correct and then
does the same for the negative test cases. (The overall score can then be
calculated manually via (correctPositive + correctNegative) / totalMessages.)
So that your code is reasonably testable, it must complete in 5 minutes or less
for the entire list of chat messages on reasonable modern-day hardware.
The full list of chat messages can be found
here, and it
consists of the 1000 latest starred messages as truthy test cases and the 1000
latest unstarred messages as falsy test cases. Note that there are two files in the gist; scroll about halfway down for the unstarred messages.

Knowing the behaviors of chat, I think the following Pyth would suffice: O2

Considering the history of past starred messages, Regex, 11 bytes: Don'?t star

What kind of encoding is used in the test files (utf-8 right?)? Whatever I try, I always get more than 1000 lines. Is there something else I'm doing wrong?

Ok I think I get it: When there are messages with code (those with <pre> and <br>) all those linebreaks within are carriage returns \r and not newlines. But when we download these files, it seems there will be \ns inserted. Suggestion @Doorknob : Remove the \rs from your testfiles.

This would be much easier if you were also given the user as part of the input.

And whether I was online at that time?

At some point I would've answered Regex, 2 bytes \^

The title should have been something like: "Don't star this challenge"

+1 for good challenge, -1 for "Do X in Y bytes". Solid sidevote here.

I think you should run this again on the next 1,000 messages, and see which one really predicted starredness

@mego i usually would agree with this but it seems like the best way to do [tag:test-battery]

Random question: how did you compile these lists?

by what starring is defined? and how to access it? BTW -1 for not a real coding but more a "know your api" challange. Since I as embedded developer have not even a chance to create a body that would inspect the input in under 50 bytes (C and C++ here...)

@Zaibis See the last paragraph. Why can't you use C? There's only a few bytes of boilerplate (int f(char*s){}).

@ETHproductions I wrote a short Ruby script to scrape the transcript URLs.

Retina, 50 bytes, 71.8% 72.15%
^.*([[CE;ಠ-ﭏ]|tar|ol|l.x|eo|a.u|pin|nu|o.f|"$)

Tried some regex golfing at @MartinBüttner's suggestion. This matches 704 starred messages and doesn't match 739 unstarred messages.
The ^.*( ... ) is to make sure that there is always either 0 or 1 match, since Retina outputs the number of matches by default. You can score the program on the input files by prepending m` for multiline mode, then running
Retina stars.retina < starred.txt

and likewise for unstarred.txt.

Analysis / explanation
I generated the above snippets (and many more) using a program, then selected the ones I wanted manually. Here's some intuition as to why the above snippets work:

C: Matches PPCG, @CᴏɴᴏʀO'Bʀɪᴇɴ
E: Matches @ETHproductions, @El'endiaStarman
;: Because the test cases are HTML, this matches < and >
ಠ-ﭏ: Matches a range of Unicode characters, most prominently for ಠ_ಠ and @Doorknob冰
tar: Matches variations of star, @El'endiaStarman (again) and also gravatar which appears in the oneboxes posted by new posts bots
ol: Matches rel="nofollow" which is in a lot of links and oneboxes
l.x: Matches @AlexA., @trichoplax
eo: Mainly matches people, but also three cases for @Geobits
a.u: Mainly matches graduation, status, feature and abuse
pin: Matches ping and words ending in ping. Also matches a few posts in a discussion about pineapple, as an example of overfitting.
nu: Matches a mixed bag of words, the most common of which is number
o.f: Matches golf, conf(irm|use)
"$: Matches a double quote as a last character, e.g. @phase He means "Jenga."

The [ is nothing special - I just had a character left over so I figured I could use it to match one more case.

(I haven't posted the testing code yet because it seems to be running rather slowly, and I'd like to figure out why. It's too late now though.)

Executing Retina once for each test case will take a long time. Multi-line mode reports the claimed score pretty much instantly.

@Dennis Thanks, I completely forgot I could do that.

LOL, now my name is a star magnet?

JavaScript ES6, 50 bytes, 71.10%
Correctly identifies 670 starred and 752 non-starred.
x=>/ .[DERv]|tar|a.u|l.x|<i|eo|ol|[C;ಠ]/.test(x)

Now across the 70% barrier, and beating everyone except Retina!
Returns true if the message contains any of these things:

A word of which the second letter is D, E, R, or v;
tar (usually star);
a and u with one char in between;
l and x with one char in between (usually alex);
italic text;
eo or ol;
a C, a semicolon, or a ಠ.

Here's a few more fruitful matches that don't seem to be worth getting rid of others:

nf
nu
yp
n.m

This has been growing closer and closer to the Retina answer, but I have found most of the improvements on my own.
Test it out in the console of one of these pages: star texts, no-star texts
var r=document.body.textContent.replace(/\n<br/g,"<br").split("\n").slice(0,-1);
var s=r.filter(function(x){return/ .[DERv]|tar|a.u|l.x|<i|eo|ol|[C;ಠ]/.test(x)}).length;
console.log("Total:",r.length,"Matched:",s,"Not matched:",r.length-s);

Here's an alternate version. /a/.test is technically a function, but doesn't satisfy our criteria:
/ .[ERv]|a.u|l.x|<i|eo|yp|ol|nf|tar|[C;ÿ-ﬀ]/.test

This scores 71.90% (697 starred, 741 unstarred).

I've been running some analyses on the lists to see which regex groups match the most starred and the least unstarred posts. The analyses can be found in this Gist. So far, I've checked aa and a.a matches. a.u is down at around #50 with a score of 28, yet it's the most efficient match of its format...

There are only 1000 messages...?

@CᴏɴᴏʀO'Bʀɪᴇɴ Some were multi-line, which wasn't accounted for in the snippet. This has been fixed.

Why no one uses /regexp/.test()? I think it's possible to squeeze in a few more cases with that.

Today I learned I can get chat stars just by saying my own name.

@n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ Thanks, dunno how I didn't think of that

Quick question: would f=/t[ao]r|l.x|bo[tx]|a.u|ol|<.>|[C;ÿ-ﬀ]/.test count as a valid answer?

@BojidarMarinov Thanks for the suggestion, but that throws an error for me. However, /t[ao]r|l.x|bo[tx]|a.u|ol|<.>|[C;ÿ-ﬀ]/.test seems borderline, since you can still call it like ("test")...

I don't think this is valid by our current consensus "The submitted code should either define a named function or evaluate to an unnamed function which can be captured in a name if desired (or if the language provides other mechanisms which allow the function to be used multiple times without repeating its definition)."

@MartinBüttner That makes sense. Thanks for letting me know.

@n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ cc ^

Pyth, 50 bytes, 67.9 %
0000000: 21 40 6a 43 22 03 91 5d d3 c3 84 d5 5c df 46 69 b5 9d  !@jC"..]....\.Fi..
0000012: 42 9a 75 fa 74 71 d9 c1 79 1d e7 5d fc 25 24 63 f8 bd  B.u.tq..y..].%$c..
0000024: 1d 53 45 14 d7 d3 31 66 5f e8 22 32 43 7a              .SE...1f_."2Cz

This hashes the input in one of 322 buckets and chooses the Boolean depending on that bucket.
Scoring
$ xxd -c 18 -g 1 startest.pyth
0000000: 72 53 6d 21 40 6a 43 22 03 91 5d d3 c3 84 d5 5c df 46  rSm!@jC"..]....\.F
0000012: 69 b5 9d 42 9a 75 fa 74 71 d9 c1 79 1d e7 5d fc 25 24  i..B.u.tq..y..].%$
0000024: 63 f8 bd 1d 53 45 14 d7 d3 31 66 5f e8 22 32 43 64 2e  c...SE...1f_."2Cd.
0000036: 7a 38                                                  z8
$ echo $LANG
en_US
$ pyth/pyth.py startest.pyth < starred.txt
[[345, False], [655, True]]
$ pyth/pyth.py startest.pyth < unstarred.txt
[[703, False], [297, True]]

CJam, 45 bytes, 65.55%
l_c"\"#&'(-.19<CEFHIJLMOPSTXY[_qಠ"e=\1b8672>|

This checks if the first character is in a specific list or the sum of all code points is larger than 8,672.
Scoring
$ cat startest.cjam
1e3{l_c"\"#&'(-.19<CEFHIJLMOPSTXY[_qಠ"e=\1b8672>|}*
$ java -jar cjam-0.6.5.jar startest.cjam < starred.txt | fold -1 | sort | uniq -c
    308 0
    692 1
$ java -jar cjam-0.6.5.jar startest.cjam < unstarred.txt | fold -1 | sort | uniq -c
    619 0
    381 1

+1 for teaching me about the fold command, along with the actual answer.

Matlab/Octave, 17 bytes 60.15%
Correctly classifies 490 messages as stared, 713 messages as unstared
Current version:
Just checking the length.
f=@(w)numel(w)>58

Old version:
Could be translated to any other language. It just checks whether the message contains the words star or not. score: 59/911/52.5%
f=@(w)nnz(strfind(lower(w),'star'))>0 %

Results for testcases using this code:
slCharacterEncoding('UTF-8');

fid = fopen('codegolf_starred_messages_starred.txt');
line = fgetl(fid);
starred = 0;
while ischar(line)
    if f(line);
        starred = starred +1;
    end

    disp(line)
    line = fgetl(fid);
end
fclose(fid);

fid = fopen('codegolf_starred_messages_unstarred.txt');
line = fgetl(fid);
unstarred = 0;
while ischar(line)
    if ~f(line);
        unstarred = unstarred +1;
    end

    disp(line)
    line = fgetl(fid);
end
fclose(fid);

disp(['  correctly classified as *ed: ',num2str(starred)])
disp(['correctly classified as un*ed: ',num2str(unstarred)])
disp(['                  total score: ',num2str((starred+unstarred)/20),'\%'])

JavaScript ES6, 0.615 = 61.5%
342 correctly identified as starred, 888 correctly identified as unstarred, (342+888)/2000 = 0.615
x=>-~x.search(/(bo|le)x|sta|ಠ|ツ/i)

Test like this on this or this:
r=document.body.innerHTML.replace(/<\/*pre>/g,"").split`
`.filter(x=>-~x.search`(bo|le)x|sta|ಠ|ツ`).length

I STILL MIGHT GET YOU, MY PRETTY!

I've got you now ;)

@ETHproductions GG. I'll look for some more common patterns.

CJam, 32 bytes, Overall score of 0.5605 (56%).
Correctly identifies 428 starred messages and 693 unstarred messages. Total score is (360+730)/2000=0.545.
l_el"sta"/,1>\,)4%!|

Not expecting to win, Ill see how it performs. Above is the code for a single message, to run with multiple use this modified version that returns amount of starred messages:
1000{l_el"star"/,1>\,)6%!|}fA]:+

Just test it with STDIN being the raw text of either file. Returns true if the message contains "star" or if length + 1 mod 4 = 0.

So... if four divides one more than the length of a message, then it has a chance of being starred?

@CᴏɴᴏʀO'Bʀɪᴇɴ Yes, but it provides for a high score

Retina, 46 bytes, 68.55
^.*([zj_C;&¡-ﬀ]|sta|san|soc|bo|eo|xk|l.x|<.>)

679 star : 692 unstar
Switched to Retina to get some more regexes in... Still not done.

Oh yeah, forgot about that. I'll fix it.

C# 6.0 (.NET Framework 4.6), 50 Bytes, 63,60%
bool s(string i)=>Regex.IsMatch(i,"ol|tar|l.x|ಠ");

Program i used for testing purposes:
void Main()
{
    var starred = @"C:\starred.txt";
    var unstarred = @"C:\unstarred.txt";

    var linesStarred = File.ReadAllLines(starred);
    var linesUnstarred = File.ReadAllLines(unstarred);

    var cls = linesStarred.Count();
    var clsc = 0;

    foreach (var line in linesStarred)
    {
        if ( s(line) ) clsc++;
    }

    var clu = linesUnstarred.Count();
    var cluc = 0;

    foreach (var line in linesUnstarred)
    {
        if (!s(line)) cluc++;
    }

    $"Starred {clsc}/{cls} correct ({(clsc/cls*100):0.00}%)".Dump();
    $"Unstarred {cluc}/{clu} correct ({(cluc /clu*100):0.00}%)".Dump();
    $"{(((clsc+cluc)/(decimal)(cls+clu))*100):0.00}".Dump();
}

bool s(string i)=>Regex.IsMatch(i,"ol|tar|l.x|ಠ");

authors: n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳


text:
Trim and Count the Decimals
In this challenge, you will write a program to output how many decimal places are in the input string and trim the input if needed.
Examples
-12.32
2

32
0

3231.432
3

-34.0
0 -34

023
0 23

00324.230
2 324.23

10
0

00.3
1 0.3

0
0

-04.8330
3 -4.833

Rules

Input will be a string which can be taken through, STDIN, function arguments or the closest equivalent
Output can be through function return, STDOUT, or the closest equivalent.
There is no limit on the size for the input integer except for your languages maximum string length.
If the input has any unnecessary (leading or trailing) zeros:

You should take them out
Output the amount of decimal place in the new number
Output the new number separated by a separator (e.g. space, newline, comma)

Input will always match this RegEx: -?\d+(\.\d+)?, or if you don't speak RegEx:

There could be a - at the beginning implying a negative number. Then there will be at least one digit. Then there could be... a . and some more digits.
To check if an input is valid, check here

No Regex

This is code-golf so shortest code in bytes wins

Maybe add a test case with minus sign and leading zeros?

Is it allowed to output the final number regardless whether it was trimmed or not?

@insertusernamehere no you can only output the second number if it has been trimmed

@nimi whoops that was a typo. I meant "number of decimal places"

You may want to add a test case/example for a single 0.

What should the output for -0 be?

@user81655 Just 0

@CᴏɴᴏʀO'Bʀɪᴇɴ If the operator matches the semantic definition of a Regular Expression as defined here then it is not allowed

-1 for the pointless regex restriction.

@CᴏɴᴏʀO'Bʀɪᴇɴ Just to explain, I added that to avoid trivial answers

@Doᴡɴɢᴏᴀᴛ I now see that Regex can trivialize an answer. Sorry, +1ing (could you edit, or something?)

PHP 7, 142 bytes
I somehow managed to squeeze everything into a single print statement:
<?=strlen((explode('.',$t=trim('-'==($_=$argv[1])[0]?$n=$_=trim($_,'-'):$_,0)))[1]).($t!==$_?($n?' -':' ').('.'==$t[0]?0:'').trim($t,'.'):'');

Runs from command line, like:
$ php trimandcount.php "-04833.010"

Demo
See all test cases including a very long one (62 characters) in action:
Try before buy1
1 Hover over the box below "Output for 7.0.0" to see all results.

Python 2, 165 180 bytes
At first I was thinking about writing my first Pyth program, got it to count the digits after the potential comma. But then I got quite annoyed, I don't know how you'd enjoy that language, guess it's just for winning purposes. Anyway here's my solution (edited since it didn't work for large numbers):
def t(i):
 o,a='',i
 while a[-1]=='0':
  a=a[:-1]
 while a[0]=='0':
  a=a[1:]
 if a[-1]=='.':a=a[:-1]
 if'.'in a:o=str(len(a)-a.index('.')-1)
 else:o='0'
 if a!=i:o+=" "+a
 print o

In case anybody wants to build on my work in Pyth: ~b@+cz"."" "1Wq@b_1"0"~b<b_1)plrb6 To see where you're at, you might want to insert a p between @+.

05AB1E, 23 bytes (non-competitive)
Damn, I was so close. Python parses very large floats using scientific notation, so I fixed this bug in the interpreter. However, this was done after the challenge and my submission is therefore non-competitive.
Code:
DÞ'.¡0Üg,\DÞ0Ü'.ÜDrQ_i,

Explanation:
D                       # Duplicate top of the stack, or input when empty
 Þ                      # Convert to float
  '.¡                   # Split on '.' (decimal point)
     0Ü                 # Remove trailing zeroes
       g                # Get the length
        ,               # Output top of the stack (the length)
         \              # Discard the top item
          D             # Duplicate top of the stack
           Þ            # Convert to float
            0Ü          # Remove trailing zeroes
              '.Ü       # Remove trailing dots
                 D      # Duplicate top of the stack
                  r     # Reverse the stack
                   Q_i, # If not equal, print top of the stack

Uses the ISO 8859-1 encoding.

JavaScript (ES6), 156 162
Edit Fixed bug for '-0' - thx @Fez Vrasta
Edit 2 6 bytes saved thx @Neil
It's a mess, but it's 100% string based - no limit due to numeric types
s=>(l=k=p=t=0,[...s].map(c=>++t&&c=='.'?p=t:+c&&(l=t,k=k||t)),m=p>l?p-1:p?l:t,k=k>p&&p?p-2:k-1,r=(s<'0'?'-':'')+s.slice(k,m),(p&&m>p?m-p:0)+(r!=s?' '+r:''))

Less golfed
f=s=>
(
  // All values are position base 1, so that 0 means 'missing'
  // k position of first nonzero digit
  // l position of last non zero digit
  // p position of decimal point
  // t string length
  l=k=p=t=0,
  // Analyze input string
  [...s].map((c,i)=>c=>++t&&c=='.'?p=t:+c&&(l=t,k=k||t)),
  // m position of last digits in output
  // if the point is after the last nz digit, must keep the digits up to before the point
  // else if point found, keep  up to l, else it's a integer: keep all
  m=p>l?p-1:p?l:t,
  // the start is the first nonzero digit for an integer
  // but if there is a point must be at least 1 char before the point
  k=k>p&&p?p-2:k-1,
  // almost found result : original string from k to m
  r=(s<'0'?'-':'')+s.slice(k,m), // but eventually prepend a minus
  (p&&m>p?m-p:0) // number of decimal digits
  +(r!=s?' '+r:'') // append the result if it's different from input
)

Test

F=s=>(l=k=p=t=0,[...s].map(c=>++t&&c=='.'?p=t:+c&&(l=t,k=k||t)),m=p>l?p-1:p?l:t,k=k>p&&p?p-2:k-1,r=(s<'0'?'-':'')+s.slice(k,m),(p&&m>p?m-p:0)+(r!=s?' '+r:''))

console.log=x=>O.textContent+=x+'\n';
// Test cases
;[['-12.32','2'],['32','0'],['3231.432','3'],['-34.0','0 -34']
 ,['023','0 23'],['00324.230','2 324.23'],['10','0'],['00.3','1 0.3']
 ,['0','0'],['-0','0'],['-04.8330','3 -4.833']]
.forEach(t=>{
  var i=t[0],k=t[1],r=F(i);
  console.log((k==r?'OK ':'KO ')+i+' -> '+r)})

function test(){var i=I.value,r=F(i);R.textContent=r;}
test()
input { width:90% }
input,span { font-family: sans-serif; font-size:14px }
Input: <input id=I oninput='test()' value='-000000098765432112345.67898765432100000'>
Output:

Test cases

Seems like both mine and your answers have problems with -0 as input.. we should output 0, not 0 0

Yes, thanks for pointing out

@FezVrasta fixed

Does c=='.'?p=t:+c&&(l=t,k=k||t) work to save you a byte?

I think you might be able to save some more by using t=l=k=p=0 and ++t&&c=='.' etc.

@Neil good suggestions as usual, thanks

No problem. How about ?l=(p=t)-1: and m=p?l:t? Still thinking about the result though, I feel there must be some scope for improvement there too.

ES6, 102 180 177 bytes

s=>(t=s.replace(/(-?)0*(\d+(.\d*[1-9])?).*/,"$1$2"),d=t.length,d-=1+t.indexOf('.')||d,t!=s?d+' '+t:d)

s=>{t=[...s];for(m=t[0]<'0';t[+m]==0&&t[m+1]>'.';)t[m++]='';r=l=t.length;for(r-=1+t.indexOf('.')||l;t[--l]<1&&r;r--)t[l]='';t[l]<'0'?t[l]='':0;t=t.join``;return t!=s?r+' '+t:r}

Edit: Saved 3 bytes thanks to @edc65; saved 1 byte thanks to insertusernamehere.

Try spread instead of split t=[...s]

@edc65 I spend ages trying to golf it back down after having to rewrite it and you go and find a 3 byte saving in a flash...

I think you can save 1 byte: Replace t[--l]==0 with t[--l]<1.

@insertusernamehere Thanks!

C++, 180 bytes
int f(char*s,char*&p){int m=*s=='-',n=0;for(p=s+m;*p=='0';++p);for(;*++s-'.'&&*s;);p-=p==s;if(*s){for(;*++s;)++n;for(;*--s=='0';--n)*s=0;*s*=n>0;}if(m&&*p-'0'|n)*--p='-';return n;}

This is portable C++, that makes no assumptions of character encoding, and includes no libraries (not even the Standard Library).
Input is passed in s.  The number of decimal places is returned; the string is modified in-place and the new start is returned in p.
By rights, I should return a size_t, but instead I'm going to claim that you should compile this for an OS that limits the size of strings to half the range of int.  I think that's reasonable; it counts more than 2 billion decimal places on 32-bit architectures.
Explanation
int f(char*s, char*&p){
    int m=*s=='-', n=0;
    for(p=s+m;*p=='0';++p);     // trim leading zeros
    for(;*++s-'.'&&*s;);        // advance to decimal point
    p-=p==s;                    // back up if all zeros before point
    if(*s){
        for(;*++s;)++n;          // count decimal places
        for(;*--s=='0';--n)*s=0; // back up and null out trailing zeros
        *s*=n>0;                 // don't end with a decimal point
    }
    if(m&&*p-'0'|n)*--p='-';    // reinstate negative sign
    return n;
}

Test program
#include <cstring>
#include <cstdio>
int main(int argc, char **argv)
{
    for (int i = 1;  i < argc;  ++i) {
        char buf[200];
        strcpy(buf, argv[i]);
        char *s;
        int n = f(buf, s);
        printf("%10s ==> %-10s (%d dp)\n", argv[i], s, n);
    }
}

Test output
    -12.32 ==> -12.32     (2 dp)
        32 ==> 32         (0 dp)
  3231.432 ==> 3231.432   (3 dp)
     -34.0 ==> -34        (0 dp)
       023 ==> 23         (0 dp)
 00324.230 ==> 324.23     (2 dp)
        10 ==> 10         (0 dp)
      00.3 ==> 0.3        (1 dp)
  -04.8330 ==> -4.833     (3 dp)
    -00.00 ==> 0          (0 dp)
       -00 ==> 0          (0 dp)
       000 ==> 0          (0 dp)
      0.00 ==> 0          (0 dp)
      -0.3 ==> -0.3       (1 dp)
         5 ==> 5          (0 dp)
        -5 ==> -5         (0 dp)


text:
Palindromic Prime Factors
Palindromic prime problems are pretty common, but that's not what this question is about. In this challenge, the number doesn't have to be a palindrome, its prime factors do.
Task
Your code has to take a single positive integer as input. Then check if any of the permutations of the prime factors of that integer are palindromic when concatenated. If so, output one of them (the list of factors, not the concatenated string). Else, you have to output -1.
This is code-golf, so shortest code in bytes wins!
Test Cases
11 -> [11]
4 -> [2, 2]
39 -> [3, 13]
6 -> -1
1207 -> [17, 71]
393 -> -1
2352 -> [2, 2, 7, 3, 7, 2, 2]

Can other distinguishable values than -1 be returned? In Perl 6 I'm thinking about Nil,Fail or other undefined values. Also can the output be any Positional value?

List, Array, Seq, Range, Buf, Slip are all Positional values. That is they do the Positional Role.

So.. should we output an empty list for 1, or -1?

-1 as element is different to one array that contain only -1

05AB1E, 7 bytes
Òœ.ΔJÂQ

Try it online!
Explanation:
Ò            # prime factorization of the input
 œ           # permutations
  .Δ         # find the first one such that
    J        # concatenated
     ÂQ      # is a palindrome

(.Δ conveniently defaults to -1, so no extra work needed)

Pyth, 14 bytes
-2 bytes by @FryAmTheEggman
h+f_IjkT.pPQ_1

Explanation:
h                 first element of
 +                (append a -1 to the end in case the filter is empty)
  f                 filter by lambda T:
   _I                 is invariant under reversing
     jkT              stringified list
   .p                over permutations of
     P Q             prime factors of Q with duplicates
  _1              -1

Thanks @FryAmTheEggman for reminding me about I. I don't think I've used it before.
Test suite

jk is the same as s\M`

CJam - 17 bytes
Thanks to Martin Büttner for saving me 10 bytes!
Wqimfe!{s_W%=}=p;

My first time writing in CJam! Explanation:
W              # Push a -1 onto the stack
q               # Get input
i               # Convert to integer
mf              # Find prime factorization
e!              # Find all permutations
{...}=          # Find permutation which...
s               # Convert to string
_               # Copy string
W%              # Get inverse
=               # Check if inverse == original
p;              # Print top of stack and discard the rest

You can reverse a string (or array) with W%. You can also use = with a block to get the first palindromic prime factorisation. That makes for 18 bytes: Wrimfe!{s_W%=}=p]; ... you can save one more by terminating with an error (since the error output goes to STDERR): Wrimfe!{s_W%=}=p;

@MartinBüttner This is why I love PPCG. Everyone is so helpful and friendly!

Ruby, 89+7=96 102+7=109
->n{n.prime_division.flat_map{|*a,b|a*b}.permutation.find{|x|x.join==x.join.reverse}||-1}

+7 for the -rprime flag.
Sigh, some Ruby builtins have such long names... at least that makes the code fairly self-explanatory.
The flat_map bit is because prime_division returns ex. [[2, 2], [3, 1]] for input 12 (which represents 2231).
Thanks to @histocrat for 13 bytes!

@histocrat That was a mistake on OP's part (see comments on the question). Thanks, that's a neat trick with the splat.

Julia, 132 122 bytes
n->(x=filter(p->(q=join(p))==reverse(q),permutations(foldl(vcat,[[repeated(k,v)...]for(k,v)=factor(n)]))))==[]?-1:first(x)

This is a lambda function that accepts an integer and returns either an array or -1. To call it, assign it to a variable.
Ungolfed:
function f(n::Int)
    # Construct an array of all prime factors of n
    P = foldl(vcat, [[repeated(k, v)...] for (k, v) in factor(n)])

    # Filter the set of permutations of this array to only
    # those such that the string constructed by concatenating
    # all elements is a palindrome
    x = filter(p -> (q = join(p)) == reverse(q), P)

    # If x is empty, return -1, otherwise get the first array
    # in the collection
    return x == [] ? -1 : first(x)
end

Saved 10 bytes thanks to Glen O!

At a glance, I see a few ways to improve this (just based on basic golfing). Use foldl rather than reduce (they do the same thing, but foldl has defined order and is one byte shorter). Use a direct comparison with an empty structure instead of isempty (I'm not 100% sure what type x is, but if it's a set, for instance, use x==[]). And use (q=join(p)) and then just q in the filter to save two more bytes.

Also, I could be mistaken, but if x is an array, then rather than first(x), just use x[].

@GlenO Thanks so much as always! I had initially tried ==[] and it was giving me errors but I tried again now and it's working. I must have messed something up before. ¯\(ツ)/¯ The only suggestion I couldn't use is getting rid of first; in this case I have to use first because x is an iterator/collection/something that doesn't have getindex defined.

Brachylog, 10 bytes
ḋp.cX↔X∨_1

Try it online!
  .           The output is
 p            a permutation of
ḋ             the prime factorization of
              the input
   c          such that concatenated
    X         it is the variable X
     ↔        which reversed
      X       is still X;
       ∨      if this is not possible,
              the output is
        _1    -1.

Initially, I had expected that having to output -1 instead of being allowed to fail would be at a fairly large byte cost, but since the output in the case of success can't be concatenated, it only costs the two bytes necessary to write _1 (if we removed those, it would leave the output unconstrained defaulting to 0, and if we additionally changed the ∨ to ∧, the predicate would fail instead), because we need to break unification with the implicit output either way. (If the concatenation was the output for success but -1 was still the output for failure, we'd have ḋpc.↔|∧_1 or ḋpc.↔.∨_1. In the shortest case, where the output is concatenated and the predicate can fail, the whole thing is only five bytes: ḋpc.↔. Although not outputting the actual factors gives it more of a decision-problem feel...)

Haskell, 122 bytes
import Data.Numbers.Primes
import Data.List
f x=head$[p|p<-permutations$primeFactors x,s<-[show=<<p],s==reverse s]++[[-1]]

Usage example: f 39 -> [3,13].
The obvious brute force approach. Iterating over all permutations of the prime factors and check for palindroms. Pick the first one. If there are none, the list is empty and the appended [-1] jumps in.

Perl 6, 100 bytes
{$/=$_;map(->\f{|({$/%f||($//=f)&&f}...^*!==f)},2..$_).permutations.first({.join.flip eq.join})||-1}

{
  # store copy of argument in $/
  $/ = $_;
  # uses $/ so that I don't have to declare a variable

  # find the prime factors
  map(
    ->\f{
      # Slip so that outer list of all prime factors is flat
      |(
        {
          $/ % f    # return modulus
          ||        # or
          ($/ /= f) # factor the prime out of $/
          &&        # and
          f         # return factor
        }
        # produce a list of them and
        # stop when it returns something other than the factor
        # also ignoring the last non-factor value
        ...^ * !== f
      )
    },
    # find the factors out of the values from 2
    # up to the original argument
    2..$_
    # don't need to skip the non-primes as their
    # prime factorization will have already be
    # factored out of $/
  )

  # try all permutations of the prime factors
  .permutations

  # find the first palindromic one
  .first({ .join.flip eq .join })

  # return -1 if .first returned Nil or empty list
  || -1
}

Usage:
# give it a lexical name
my &prime-palindrome = {...}

say prime-palindrome    1; # -1
say prime-palindrome    2; # (2)
say prime-palindrome   11; # (11)
say prime-palindrome   13; # -1
say prime-palindrome   39; # (3 13)
say prime-palindrome   93; # (31 3)
say prime-palindrome    6; # -1
say prime-palindrome 1207; # (17 71)
say prime-palindrome  393; # -1
say prime-palindrome 2352; # (2 2 7 3 7 2 2)
say prime-palindrome 2351; # -1
say prime-palindrome 2350; # -1

About half of it (53 bytes) is taken up with the prime factorization code.
$/=$_;map(->\f{|({$/%f||($//=f)&&f}...^*!= f)},2..$_)

If there were a prime-factorize method the whole thing could be significantly shorter.
{.prime-factorize.permutations.first({.join.flip eq.join})||-1} # 63

A shorter prime factor code section could be $!=$_;({+$!/($!/=1+(2...$!%%*))}...{2>$!})

Jelly, 16 bytes
ÆFŒṙŒ!VŒḂ$ƇḢ¹-¹?

Longer than I expected, both in the byte count and the time it took to write.
Try it online!
Explanation:
ÆFŒṙŒ!VŒḂ$ƇḢ¹-¹?
ÆFŒṙ                Get the prime factors (gets them as exponents then run-length decodes).
    Œ!              Get the permutations.
          Ƈ         Filter (keep) the ones that...
       ŒḂ$          ...are palindromic when...
      V             ...joined.
           Ḣ        Take the first.
              ¹?    If the value is truthy...
            ¹       ...return the value...
             -      else return -1.

Japt -F-1, 9 bytes
k á æ_¬êS

Try it

Your link is not ok in this window phone...

@RosLuP The interpreter is still fairly new. I'll ping Shaggy, the creator. Here's a TIO link

@RosLuP, what browser are you using?

Internet Explorer for Windows Phone 8.1: (cellphone) something that is disappearing , possibly it is better I use my brand new phone android or the browser of windows 10 (Edge it seems they call)

Japt, 18 bytes
Almost as short as CJam...
Uk á f_¬¥Z¬w} g ªJ

Try it online!
How it works
        // Implicit: U = input, e.g. 2352
Uk      // Factorize the input.      [2,2,2,2,3,7,7]
á       // Take permutations.        [[2,2,2,2,3,7,7],[2,2,2,2,7,3,7],[2,2,2,7,2,3,7],...]
f_   }  // Filter to only the ones that return truthily to this function:
Z¬¥Z¬w  //  Return Z.join('') == Z.join('').reverse().
        //                           [[2,2,7,3,7,2,2],[2,7,2,3,2,7,2],[7,2,2,3,2,2,7]]
g       // Take the first item.      [2,2,7,3,7,2,2]
ªJ      // If falsy, resort to -1.   [2,2,7,3,7,2,2]

JavaScript (ES6), 256 244 208 187 bytes
Saved 36 bytes thanks to @Neil
x=>eval("for(a=[],i=2;x>1;x%i?i++:(a.push(i),x/=i));p=-1,f=(z,t=[])=>z[0]?z.map((u,i)=>f([...z.slice(0,i),...z.slice(i+1)],[...t,u])):(y=t.join``)==[...y].reverse().join``&&(p=t),f(a),p")

Defines an anonymous function; prepend e.g. F= to use it. It's actually quite fast on input of 2352, only taking ~150 milliseconds to finish on my computer.

I don't know about faster but definitely shorter: x=>eval("for(a=[],i=2;x>1;x%i?i++:(a.push(i),x/=i));p=[],f=(z,t=[])=>z.length?z.map((u,i)=>f([...z.slice(0,i),...z.slice(i+1)],[...t,u])):(y=t.join\`)==[...y].reverse().join``&&p.push(t),f(a),p[0]||-1")`

@Neil Thanks, that also happens to be a few times faster than my algorithm!

36 bytes? I think that must be a record for me.

APL(NARS), 169 chars, 338 bytes
∇r←F w;i;k;a;m;j
  r←⊂,w⋄→0×⍳1≥k←↑⍴w⋄a←⍳k⋄j←i←1⋄r←⍬⋄→C
A: m←i⊃w⋄→B×⍳(i≠1)∧j=m⋄r←r,m,¨∇w[a∼i]⋄j←m
B: i+←1
C: →A×⍳i≤k
∇
G←{F⍵[⍋⍵]}
f←{∨/k←{⍵≡⌽⍵}¨∊¨⍕¨¨v←Gπ⍵:↑k/v⋄¯1}

G would be the function find the permutations and f is the function of this exercise; test:
  ⎕fmt f¨11 4 39 6 1207 393 2352
┌7───────────────────────────────────────────────────┐
│┌1──┐ ┌2───┐ ┌2────┐    ┌2─────┐    ┌7─────────────┐│
││ 11│ │ 2 2│ │ 3 13│ ¯1 │ 17 71│ ¯1 │ 2 2 7 3 7 2 2││
│└~──┘ └~───┘ └~────┘ ~~ └~─────┘ ~~ └~─────────────┘2
└∊───────────────────────────────────────────────────┘


text:
Irreducible polynomials over GF(5)
A polynomial with coefficients in some field F is called irreducible over F if it cannot be decomposed into the product of lower degree polynomials with coefficients in F.
Consider polynomials over the Galois field GF(5). This field contains 5 elements, namely the numbers 0, 1, 2, 3, and 4.
Task
Given a positive integer n, compute the number of irreducible polynomials of degree n over GF(5). These are simply the polynomials with coefficients in 0-4 which cannot be factored into other polynomials with coefficients in 0-4.
Input
Input will be a single integer and can come from any standard source (e.g. STDIN or function arguments). You must support input up to the largest integer such that the output does not overflow.
Output
Print or return the number of polynomials that are irreducible over GF(5). Note that these numbers get large rather quickly.
Examples
In : Out
 1 : 5
 2 : 10
 3 : 40
 4 : 150
 5 : 624
 6 : 2580
 7 : 11160
 8 : 48750
 9 : 217000
10 : 976248
11 : 4438920

Note that these numbers form the sequence A001692 in OEIS.

PARI/GP 46 bytes on A001692 ;) Is there a time limit?

@Bruce_Forte Nope.

Jelly, 30 23 22 20 bytes
ÆF>1’PḄ
ÆDµU5*×Ç€S:Ṫ

Try it online! or verify all test cases at once.
Algorithm
This uses the formula
$$\text{A001692}(n) = \frac 1 n \sum_{d|n} \mu(d)5^\frac n d$$
from the OEIS page, where \$d | n\$ indicates that we sum over all divisors \$d\$ of \$n\$, and \$\mu\$ represents the Möbius function.
Code
ÆF>1’PḄ       Monadic helper link. Argument: d
              This link computes the Möbius function of d.

ÆF            Factor d into prime-exponent pairs.
  >1          Compare each prime and exponent with 1. Returns 1 or 0.
    ’         Decrement each Boolean, resulting in 0 or -1.
     P        Take the product of all Booleans, for both primes and exponents.
      Ḅ       Convert from base 2 to integer. This is a sneaky way to map [0, b] to
              b and [] to 0.

ÆDµU5*×Ç€S:Ṫ  Main link. Input: n

ÆD            Compute all divisors of n.
  µ           Begin a new, monadic chain. Argument: divisors of n
   U          Reverse the divisors, effectively computing n/d for each divisor d.
    5*        Compute 5 ** (n/d) for each n/d.

       Ç€     Map the helper link over the (ascending) divisors.
      ×       Multiply the powers by the results from Ç.
         S    Add the resulting products.
          :Ṫ  Divide the sum by the last divisor (n).

I love these Jelly answers to hard math ! :)

Mathematica, 39 38 bytes
DivisorSum[a=#,5^(a/#)MoebiusMu@#/a&]&

Uses the same formula as the Jelly answer.

+1 for teaching me about the named-function operator, but I think it's a byte shorter without: DivisorSum[n=#,5^(n/#)MoebiusMu@#/n&]&

Python 3, 59 bytes
f=lambda n:(5**n-sum(d*f(d)for d in range(1,n)if n%d<1))//n

Try it online!
This uses the formula
$$f(n) = \frac 1 n \sum_{d|n} \mu(d)5^\frac n d$$
but applies Möbius inversion to turn it into
$$5^n = \sum_{d|n} f(d) d$$
and solves for \$f(n)\$.
55 bytes
f=lambda n,d=1:d//n*5**n/n or f(n,d+1)-d*f(d)*(n%d<1)/n

Try it online!
Has float precision issues for larger inputs.

Scala, 74 bytes
Port of @xnor's Python answer in Scala.
Use the formula: \$5^n = \sum\limits_{d|n} f(d) d\$
Try it online!
n=>{(BigInt(5).pow(n)-(1 until n).filter(d=>n%d==0).map(d=>d*f(d)).sum)/n}

Pari/GP, 17 bytes
n->ffnbirred(5,n)

Try it online!

Pari/GP, without built-in, 33 bytes
n->sumdiv(n,d,5^d*moebius(n/d))/n

Try it online!


text:
Output the spoken names of numbers used on planet Flapus
The residents of Flapus use a base-8 number system. The numbers are:
0 - Kuzla
1 - Ponara
2 - Boqkel
3 - Colopee
4 - Vruenat
5 - Foham
6 - Stikty
7 - Kricola
For numbers over 7, the full name of the last digit comes first, followed by apostrophe and the first characters of the other digit(s), up to and including the first vowel:
11 - Ponara(1)'po(1)
13 - Colopee(3)'po(1)
64 - Vruenat'sti
55 - Foham'fo
47 - Kricola'vru
As the numbers go up, the formula stays the same - the full name last digit comes first, followed by an apostrophe and the first characters of the other digits, up to and including the first vowel. Note that apart from the final digit (first word), the order remains the same.
123 - Colopee(3)'po(1)bo(2)
205 - Foham(5)'bo(2)ku(0)
1123 - Colopee'popobo
7654 - Vruenat'kristifo
The exception to the rule is for numbers ending in 0. Here the word begins with Ku and is completed with the first letters of the other digits, up to and including the first vowel. No apostrophe is used.
10 - Kupo
70 - Kukri
350 - Kucofo
630 - Kustico
1000 - Kupokuku
Challenge
Write a program or function that accepts a valid base-8 number, and outputs the spoken equivalent. You may assume you will always receive a valid number. Trailing whitepace / single newline after your answer is ok. The first character needs to be upper-case, as per examples.
This is code-golf. Shortest code in bytes wins. Standard loopholes apply. Answers whose lengths are converted and additionally submitted in Flapussian get extra cookies.
Test cases
0 -> Kuzla
1 -> Ponara
2 -> Boqkel
3 -> Colopee
4 -> Vruenat
5 -> Foham
6 -> Stikty
7 -> Kricola
10 - > Kupo
11 -> Ponara'po
23 -> Colopee'bo
56 -> Stikty'fo
70 -> Kukri
100 -> Kupoku
222 -> Boqkel'bobo
2345 -> Foham'bocovru

Now that I think of it, the numbers all sound pretty cute

Pyth, 117 bytes (Kricola'popo)
Jc"Ku Po Bo Co Vru Fo Sti Kri";K+kc"nara qkel lopee enat ham kty cola";=TsezIszp@JTp@KTp?&T>sz7\'kVPzpr@JsN0;.?"Kuzla

Hand-transpiled to pythonic pseudocode:
                                           z = input()      # unevaluated, raw
                                           k = ""
Jc"Ku Po Bo Co Vru Fo Sti Kri";            J = "Ku Po...Kri".split()
K+kc"nara qkel lopee enat ham kty cola";   K = k + "nara...cola".split() # k casted to [""]
=Tsez                                      T = int(end(z))  # end(z) means z[-1]
Isz                                        if int(z):
  p@JT                                         print(J[T])
  p@KT                                         print(K[T])
  p?&T>sz7\'k                                  print("'" if T and s > z else k)
  VPz                                          for N in z[:-1]:  # P(z) is z[:-1]
    pr@JsN0                                        print(J[int(N)].lower())
.?                                         else:
  "Kuzla                                       print("Kuzla")

Nice work! You can save a few bytes by changing your if ... else into a ternary by changing your for loop into a map operation, and then making some minor changes. Here is what I got. I'd also draw your attention to ." which can be used on compressed strings.

@FryAmTheEggman I was aware of .", but I totally didn't expect it could compress the first string!

Retina, Colopee'pokri, 165 157 143 127 123 bytes
(.+)(.)
$2'$1
0
Kuzla
1
Ponara
2
Boqkel
3
Colopee
4
Vruenat
5
Foham
6
Stikty
7
Kricola
(?<='.*[iou])[a-z]+

T`L`l`'.+
zla'

The trailing linefeed is significant.
Try it online!
Explanation
(.+)(.)
$2'$1

We start by bringing the trailing digit to the front and inserting an apostrophe after it. Note that this leaves single-digit numbers unchanged, since the regex doesn't match - so those never get an apostrophe in the first place.
0
Kuzla
1
Ponara
2
Boqkel
3
Colopee
4
Vruenat
5
Foham
6
Stikty
7
Kricola

This replaces each digit with its full name, regardless of where it appears.
(?<='.*[iou])[a-z]+

This shortens all the digit names that appear after an apostrophe. Note that only the vowels iou appear first in a digit name, so we check a position that is right after one of those, and after an apostrophe and then match (and remove) all lower case letters that follow that position. Since we've inserted the digit names in title case, this will stop before the next digit.
T`L`l`'.+

This uses transliteration to turn all upper case characters, L, into their lower case counterpart, l, provided they are found in a match that starts with ' (in order to leave the leading capital untouched).
zla'

The only thing that's left is correctly handling multiples of (octal) 10. In that case, we'll have a result starting with Kuzla', which we want to start with Ku instead. So we simply remove all occurrences of zla'.

I refactored and used your regex approach - saves 10 bytes! I don't think I can squeeze much more out of my Java solution. Still miles away from yours though!

Java (1.8) - Vruenat'fobo (486 340 bytes)
Just when I thought I couldn't possibly golf this any more, I found another 33 bytes! Very pleased! Biggest savings were from switching to char arrays (shorter to upper/lowercase), and reusing the input string array for the words.
Discovering loads of golfing tricks, down to under 400! In theory I could still reduce this more, as I said a function would be ok in the rules, whereas this is a full program.
Updated
Using Martin Büttner's approach, I refactored to use regex instead. Managed to save another 10 bytes! Thanks Martin.
interface F{static void main(String[]n){String t="",o,a=n[0];n="Kuzla,Ponara,Boqkel,Colopee,Vruenat,Foham,Stikty,Kricola".split(",");int i=0,l=a.length()-1;char f=a.charAt(l);o=n[f-48]+(l>0?"'":"");while(i<l)t+=n[a.charAt(i++)-48];o+=t.replaceAll("(?<=.*[iou])[a-z]+","").toLowerCase();if(f==48)o=o.replace("zla'","");System.out.print(o);}}

Ungolfed
interface Flapus {
static void main(String[] names) {
    String temp="",out, a = names[0];
    names = "Kuzla,Ponara,Boqkel,Colopee,Vruenat,Foham,Stikty,Kricola".split(",");
    int i=0, last = a.length()-1;
    char lastchar = a.charAt(last);

    out=names[lastchar-48]+(last>0?"'":"");
    while(i<last) {
        temp+=names[a.charAt(i++)-48];
    }
    out+=temp.replaceAll("(?<=.*[iou])[a-z]+", "").toLowerCase();
    if (lastchar==48) {
        out=out.replace("zla'","");
    }
    System.out.print(out);
}
}

You can use interface F and remove the public declaration on the main method. You can also remove the space in String[] x and in .substring(0, v+1).

You could save some more bytes by generating the array from a split string : "Kuzla,Ponara,Boqkel,Colopee,Vruenat,Foham,Stikty,Kricola".split(",") is 70 bytes, while the inline array is 74.

Try as I might, I can't seem to golf this any harder. Anyone out there with any further tips?

JavaScript (ES6), 171
n=>(x='Kuzla Ponara Boqkel Colopee Vruenat Foham Stikty Kricola ku po bo co vru fo sti kri'.split` `,r=x[d=+(n=[...n]).pop()],n.map(d=>r+=x[+d+8],n[0]?r=d?r+"'":'Ku':0),r)

Test

F=n=>(
  x='Kuzla Ponara Boqkel Colopee Vruenat Foham Stikty Kricola ku po bo co vru fo sti kri'.split` `,
  r=x[d=+(n=[...n]).pop()],
  n.map(d=>r+=x[+d+8],n[0]?r=d?r+"'":'Ku':0),
  r
)

console.log=x=>O.textContent+=x+'\n'

o=''
for(i=0;i<999;i++)
  o+=i.toString(8) +':'+ F(i.toString(8))+(i%8!=7?' ':'\n')
console.log(o)
#O { font-size:12px }

Python (3.5) 225 222 217 202 bytes
A working solution with list comprehension in python
s=input()
d="Kuzla,Ponara,Boqkel,Colopee,Vruenat,Foham,Stikty,Kricola".split(',')
r=d[int(s[-1])]+"'"if s[-1]!='0'else'Ku'
d=[i[:2+(i[2]in'ui')].lower()for i in d]
for i in s[:-1]:r+=d[int(i)]
print(r)

Explanation
d="Kuzla,Ponara,Boqkel,Colopee,Vruenat,Foham,Stikty,Kricola".split(',')

Win 3 bytes with the split version (previous version: d="Kuzla","Ponara",...)
r=d[int(s[-1])]+"'"if s[-1]!='0'else'Ku'

Initialisation of the result in function of the last digit
d=[i[:2+(i[2]in'ui')].lower()for i in d]

Change the d list to keep first 2 or 3 characters and put in lower case
for i in s[:-1]:r+=d[int(i)]

Cat the string

2345 returns Foham'bocovr. It should return Foham'bocovru. This is because you are only reading 2 characters, instead of up to and including the first vowel. Pesky Vruenat

Same problem for 'Stikty' and 'Kricola'

@Denham Coote oops I forgot to answer your comments.
thanks for your remarks, I corrected the issues

Javascript ES6, 231 228 225 222 204 bytes
a=[...prompt(c="Kuzla,Ponara,Boqkel,Colopee,Vruenat,Foham,Stikty,Kricola".split`,`)];b=c[a.pop()];a.length?b=b==c[0]?"Ku":b+"'":0;for(;a.length;)b+=c[a.shift()].match(/.+?[iou]/)[0].toLowerCase();alert(b)

Saved a bunch of bytes thanks to Neil.

General golfing tips: [...s] instead of s.split\`; b=b==c[0]?"Ku":b+"'"instead ofif(b==c[0]){b="Ku"}else b+="'"; similarly for the if(a.length)(just use0for theelsepart);a.map(d=>b+=c[d].match...)instead of fiddling around withforandshift`. I think that's 29 bytes saved already.

Peeking at someone else's answer suggests you can save another 2 bytes because you only need to use [iou] as your "vowel" class.

@Neil Thanks. I'll do that.

F#, 364 288 250 bytes (Kubofo)
let M="Ku-Ponara-Boqkel-Colopee-Vruenat-Foham-Stikty-Kricola".Split '-'
let m="Ku-Po-Bo-Co-Vru-Fo-Sti-Kri".Split '-'
let rec r a=function|0->a|i->r(m.[i%10].ToLower()::a)(i/10)
fun i->String.concat""<|M.[i%10]::((if(i%10)=0 then""else"'")::r[](i/10))

Returns a function that takes an integer and returns its Flapus equivalent. =D

Python 3 - 181 177 bytes (Ponara'bosti)
a='Ku Po Bo Co Vru Fo Sti Kri zla nara qkel lopee enat ham kty cola'.split()
*y,x=map(int,input())
u=x>0
v=y>[]
print(a[x]+a[x+8]*u**v+"'"*(u&v)+''.join(a[i].lower()for i in y))

Beware of the most amazing use of pow you will ever see in your entire life. u**v is equivalent on boolean context as u|(not v) which was previously golfed to the nice ~v+2|u expression!


text:
Sort scrambled two-dimensional array filled with numbers by swapping adjacent numbers
A two-dimensional array of size n×n is filled with n*n numbers, starting from number 1. Those numbers are to be sorted per row in ascending order; the first number of a row must be greater than the last number of the previous row (the smallest number of all (1) will be in [0,0]). This is similar to the 15 puzzle.
This is, for example, a sorted array of size n = 3.
1 2 3
4 5 6
7 8 9

Input
The input is a scrambled array. It can be of any size up to n = 10. Example for n = 3:
4 2 3
1 8 5
7 9 6

Output
Output a list of swaps required to sort the array. A swap is defined as following: Two adjacent numbers swap positions, either horizontally or vertically; diagonal swapping is not permitted.
Example output for the example above:

Swap 4 and 1
Swap 8 and 5
Swap 8 and 6
Swap 9 and 8

The less swaps required, the better. Computation time must be feasible.

Here is another example input, with n = 10:
41 88 35 34 76 44 66 36 58 28
6 71 24 89 1 49 9 14 74 2
80 31 95 62 81 63 5 40 29 39
17 86 47 59 67 18 42 61 53 100
73 30 43 12 99 51 54 68 98 85
13 46 57 96 70 20 82 97 22 8
10 69 50 65 83 32 93 45 78 92
56 16 27 55 84 15 38 19 75 72
33 11 94 48 4 79 87 90 25 37
77 26 3 52 60 64 91 21 23 7

If I'm not mistaken, this would require around 1000-2000 swaps.

Is this a puzzle, speed, or golfing problem?

@MichaelKlein This is a puzzle.

Is it scored? What ranges need to be handled?

@MichaelKlein The lower the number of swaps, the better the solution is.

Welcome to PPCG. All questions on this site are required to be challenges, with a winning criterion to compare all valid answers against each other. I would suggest code golf (shortest code), as there is quite an efficient algorithm for this in an optimal number of swaps. But I would insist that  the solution be optimal and that it complete in under a minute for n=1000. (It's impossible for your n=10 example to have more that 100 swaps.)

@steveverrill I'm afraid it is quite impossible to solve the n=10 example in less than 100 swaps (or even 1000; but please prove me wrong). Still, the number of swaps is the winning criterion (though computation must be feasible!), the one who comes up with a solution with the lowest number of swaps wins.

@JCarter I think you meant to say that only adjacent numbers may be swapped?

@quintopia that's what I was missing

@steveverrill yes, otherwise you are right that any 10x10 array can be sorted in under 200 swaps

@steveverrill Oh, you are right! Only adjacent numbers can swap (horizontally and vertically but not diagonally). I must have forgot to put it in the description. I've added it now, thanks!

What is the distribution of inputs for the win conditions? Also, "feasible" computation time is too loose.

@xnor The win condition is met when the array is fully sorted. Feasible computation time should mean that it should take no longer than 5 minutes on a standard desktop PC to compute.

@JCarter -0.1 for "standard desktop PC". Seriously, the average desktop computer of Jan '10 is 64 times slower than the average desktop computer of Jan '16.

Mathematica, not golfed
towards[a_,b_]:={a,a+If[#==0,{0,Sign@Last[b-a]},{#,0}]&@Sign@First[b-a]};
f[m_]:=Block[{m2=Map[QuotientRemainder[#-1,10]+1&,m,{2}]},
  Rule@@@Apply[10(#1-1)+#2&,#,{2}]&@
    Reap[Table[
      m2=NestWhile[
        Function[{x},x/.(Sow[#];Thread[#->Reverse@#])&[x[[##]]&@@@towards[First@Position[x,i,{2}],i]]]
        ,m2,#~Extract~i!=i&];
      ,{i,Reverse/@Tuples[Range[10],2]}];][[2,1]]]

Explanation:
The algorithm is similar to "bubble sort". These 100 numbers are put into correct order one by one, 1, 11, 21, ..., 91; 2, ..., 92; ...; 10, ..., 100. They are first move up/down to the correct rows, and then move left to the correct columns.
Function towards gives the two position to swap. For example, if {5,2} is moving to {1,1}, towards[{5,2},{1,1}] gives {{5,2},{5,1}} (move up); and  towards[{5,1},{1,1}] gives {{5,1},{4,1}} (move left).

Results:
For the test case, the total number of swaps is 558. The first few swaps are,
{1->76,1->34,1->35,1->88,1->41,11->16,11->69,11->46, ...

For a random configuration, the total number of swaps is 558.5 ± 28.3 (1σ).