Name the poker hand - 7 cards edition The Challenge:
In this question: Name the poker hand you had to take a five card poker hand and identify it. This question is similar, with two twists:
First, the output will be in all lower case. This allows for more golfing, as you don't have to worry about the capitalization of flush and straight
high card
one pair
two pair
three of a kind
straight
flush
full house
four of a kind
straight flush
royal flush

Secondly, with the popularity of Texas Hold'em and 7 card stud, we here at code golf should be able to score a seven card poker hand am I right? When scoring a seven card hand, use the five best cards for your hand and ignore the two you don't need.
Reference:
List of poker hands: http://en.wikipedia.org/wiki/List_of_poker_hands
Input (lifted directly from the previous thread)
7 cards from either stdin or commandline arguments.
A card is a two letter string on the form RS, where R is rank and S is suit.
The ranks are 2 - 9 (number cards), T (ten), J (Jack), Q (Queen), K (King), A (Ace).
The suits are S, D, H, C for spades, diamonds, hearts and clubs respectively.
Example of cards
5H - five of hearts
TS - ten of spades
AD - ace of diamonds

Example of input =&gt; desired output
3H 5D JS 3C 7C AH QS =&gt; one pair
JH 4C 2C 9S 4H JD 2H =&gt; two pair
7H 3S 7S 7D AC QH 7C =&gt; four of a kind
8C 3H 8S 8H 3S 2C 5D =&gt; full house
AS KC KD KH QH TS JC =&gt; straight

Notice in the second example there are actually three pairs, but you can only use five cards, so it's two pair. In the fifth example, there are both a three of a kind and a straight possible, but a straight is better, so output straight.
Scoring
This is code-golf, so shortest code wins!
Errata

You may not use external resources.
Ace is both high and low for straights.
Haskell 618 603 598 525 512 504 480 464

Cards taken as a line of input. I think I've golfed this to death, but will easily be beaten by ruby etc using the same trick: if you generate all permutations, you get the forward sorts you want to look for straights, plus the reverse sorts you want for testing N of a kind.

import Data.List
m=map
z=take 5
q=m(\x-&gt;head[n|(f,n)&lt;-zip"A23456789TJQK"[1..],f==x!!0])
l=m length
v=" of a kind"
w="flush"
y="straight"
c f s p r|f&amp;&amp;r="9royal "++w|f&amp;&amp;s='8':y++" "++w|f='5':w|s||r='4':y|True=case p of 4:_-&gt;"7four"++v;3:2:_-&gt;"6full house";3:_-&gt;"3three"++v;2:2:_-&gt;"2two pair";2:_-&gt;"1one pair";_-&gt;"0high card"
d x=c([5]==l(group$m(!!1)x))(q x==z[head(q x)..])(l$group$q x)$q x==1:[10..13]
k h=tail$maximum$m(d.z)$permutations$words h
main=interact k


Edited to inline "pair" and use number prefixes after seeing @FDinoff's entry, also composed map functions to shave one more char.