/*
 * BEGIN FLOCK GPL
 * 
 * Copyright Flock Inc. 2005-2006
 * http://flock.com
 * 
 * This file may be used under the terms of of the
 * GNU General Public License Version 2 or later (the "GPL"),
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 * 
 * END FLOCK GPL
 */

#include "nsISupports.idl"
#include "nsIArray.idl"

[scriptable, uuid(b623a7b3-4220-464d-bf5d-d505e5ef49eb)]
interface flockIPost : nsISupports {
    attribute AString title;
    attribute AString link;
    attribute AString description;
    // Words is really all that we care about, it is a vector of the words in
    // the post stored as a string with the format:
    // word|frequency\n
    attribute AString words;
};

[scriptable, uuid(da2fff7e-98dc-4d01-870c-5086b0859465)]
interface flockICluster : nsISupports {
    // The most interesting word in the cluster
    attribute AString keyword;
    // The second-most interesting word in the cluster
    attribute AString keyword2;

    // An array of nsISupportsPRUint32s corresponding to indices into the
    // posts array passed into flockIClusterer.cluster for the posts in this
    // cluster.
    attribute nsIMutableArray posts; 
};

[scriptable, uuid(41d019a4-b6e9-4ead-ba8d-b592e1876181)]
interface flockIClusterer : nsISupports {
    // Returns an array of flockIClusters.
    nsIMutableArray cluster(in PRUint32 numPosts,
                            [array,size_is(numPosts)] in flockIPost posts);
};

