[Question]
  [
**Input:** You will be passed a string containing a single english word. All letters will be lowercase, and there will be no non-alphabetic characters in the string.
**Output:** You will return an integer from 1 to 7 representing how many syllables you think are in the word.
**Scoring:** Your program will be run against all of the words found on [this repository](https://github.com/nathanmerrill/wordsbysyllables). If you get `N` words correct, and your program is `M` bytes large, then your score is `N-(M*10)`. Largest score wins.
To generate my syllable count, I used [this](https://en.wiktionary.org/wiki/Wiktionary:Frequency_lists/PG/2006/04/1-10000) as my word list and [this](http://www.gutenberg.org/ebooks/3204) to count the syllables.
  
[Answer]
# Ruby, 8618 correct (91.1%), 53 bytes, 8618 - 10 \* 53 = 8088 score
```
->s{s.scan(/[aiouy]+e*|e(?!d$|ly).|[td]ed|le$/).size}
```
This is an anonymous Ruby function which uses regexes to count syllables.
The function adds a syllable for every instance of:
* A run of non-`e` vowels, followed by zero of more `e`s
* An `e` which is *not* part of a trailing `ed` or `ely`, with the exception of trailing `ted` or `ded`s
* A trailing `le`
## Analysis
The basic idea is to count runs of vowels, but this by itself isn't very accurate (`[aeiouy]+` gets 74% correct). The main reason for this is because of the [silent `e`](https://en.wikipedia.org/wiki/Silent_e), which modifies the previous vowel sound while not being pronounced itself. For example, the word `slate` has two vowels but only one syllable. 
To deal with this, we take `e` out of the first part of the regex and treat it separately. Detecting silent `e`s is hard, but I found two cases where they occur often:
* As part of a trailing `ed` (unless it's a `ted` or `ded` like `settled` or `saddled`),
* As part of a trailing `evy` (e.g. `lovely`)
These cases are specifically excluded in what would otherwise be `e.`.
The reason for the `.` in `e(?!d$|ly).` is to consume the next char if there is a double vowel (e.g. `ea` or `ee`), and so that `e` at the end of the word are not counted. However a trailing `le` *is* usually pronounced, so that is added back in.
Finally, vowel runs are counted as one syllable. While this may not always be the case (e.g. `curious`), it's often difficult to work out whether there are multiple syllables. Take the `ia` of `celestial` and `spatial`, as an example.
## Test program
I don't really know Ruby so I'm not sure how well it can be golfed. I did manage to scrape together a test program by consulting a lot of SO though:
```
cases = 0
correct = 0
s = "->s{s.scan(/[aiouy]+e*|e(?!d$|ly).|[td]ed|le$/).size}"
f = eval s
for i in 1 ... 8
    filepath = i.to_s + "-syllable-words.txt"
    file = File.open(filepath)
    while (line = file.gets)
        word = line.strip
        cases += 1
        if f.call(word) == i
            correct += 1
        end
    end
end
p "Correct: #{correct}/#{cases}, Length: #{s.length}, Score: #{correct - s.length*10}"
```
[Answer]
# Python3, 7935 - 10 \* 71 = 7225
My quick-and-dirty answer: count runs of consecutive vowels, but remove any final e's first.
```
lambda w:len(''.join(" x"[c in"aeiouy"]for c in w.rstrip('e')).split())
```
After stripping off the e's, this replaces vowels with `x` and all other characters with a space. The result is joined back into a string and then split on whitespace. Conveniently, whitespace at the beginning and end is ignored (e.g. `" x xx ".split()` gives `["x","xx"]`). The length of the resulting list is therefore the number of vowel groups.
The original, 83-byte answer below was more accurate because it only removed a single e at the end. The newer one thus has problems for words like `bee`; but the shortened code outweighs that effect.
```
lambda w:len(''.join(" x"[c in"aeiouy"]for c in(w[:-1]if'e'==w[-1]else w)).split())
```
Test program:
```
syll = lambda w:len(''.join(c if c in"aeiouy"else' 'for c in w.rstrip('e')).split())
overallCorrect = overallTotal = 0
for i in range(1, 7):
    with open("%s-syllable-words.txt" % i) as f:
        words = f.read().split()
    correct = sum(syll(word) == i for word in words)
    total = len(words)
    print("%s: %s correct out of %s (%.2f%%)" % (i, correct, total, 100*correct/total))
    overallCorrect += correct
    overallTotal += total
print()
print("%s correct out of %s (%.2f%%)" % (overallCorrect, overallTotal, 100*overallCorrect/overallTotal))
```
Evidently this was too dirty and not quick enough to beat Sp3000's Ruby answer. ;^)
[Answer]
# Perl, 8145 - 3 \* 30 = 7845
Using the lists from before the recent commits.
```
#!perl -lp
$_=s/(?!e[ds]?$)[aeiouy]+//g
```
[Answer]
# Python, 5370-10\*19 = 5180
This program simply assumes that longer words means more syllables.
```
lambda x:len(x)/6+1
```
The tester program I use is:
```
correct = 0
y = lambda x:len(x)/6+1
for i in xrange(1,8):
    f = file(str(i)+"-syllable-words.txt")
    lines = f.read().split("\n")
    f.close()
    correct += len([1 for line in lines if y(line)==i])
print correct
```
]