From 5dcf426cdf13f04b2cf27167a67412cf6e787d5c Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Sat, 31 Mar 2012 10:03:53 -0400 Subject: [PATCH] TWK-770: Fix echonest sentence summary grammar --- .../playlist/dynamic/echonest/EchonestGenerator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.cpp b/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.cpp index dcb34acef..dd55845e8 100644 --- a/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.cpp +++ b/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.cpp @@ -597,7 +597,9 @@ EchonestGenerator::sentenceSummary() suffix = ", "; else suffix = "."; - } else + } else if ( i < required.size() - 2 ) // An item in the list that is before the second to last one, don't use ", and", we only want that for the last item + suffix += ", "; + else suffix += ", and "; } sentence += center + suffix;