diff python/tests/utils.txt @ 746:e7ff0f60fef8

merged new developments (indicator and trajectory clustering)
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 10 Sep 2015 15:52:45 -0400
parents 4b3518f6dd01
children 8e8ec4ece66e
line wrap: on
line diff
--- a/python/tests/utils.txt	Mon Aug 10 01:06:59 2015 -0400
+++ b/python/tests/utils.txt	Thu Sep 10 15:52:45 2015 -0400
@@ -1,6 +1,14 @@
 >>> from utils import *
 >>> from moving import Point
 
+>>> upperCaseFirstLetter('mmmm... donuts')
+'Mmmm... Donuts'
+>>> s = upperCaseFirstLetter('much ado about nothing')
+>>> s == 'Much Ado About Nothing'
+True
+>>> upperCaseFirstLetter(s) == s
+True
+
 >>> computeChi2([],[])
 0.0
 >>> computeChi2(range(1,10),range(1,10))
@@ -50,6 +58,13 @@
 >>> mostCommon([range(2), range(4), range(2)])
 [0, 1]
 
+>>> res = sortByLength([range(3), range(4), range(1)])
+>>> [len(r) for r in res]
+[1, 3, 4]
+>>> res = sortByLength([range(3), range(4), range(1), range(5)], reverse = True)
+>>> [len(r) for r in res]
+[5, 4, 3, 1]
+
 >>> lcss = LCSS(similarityFunc = lambda x,y: abs(x-y) <= 0.1)
 >>> lcss.compute(range(5), range(5))
 5