added learning from an array of sentences; tests added