home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / indexing / IXWeightingDomain.h < prev    next >
Text File  |  1992-03-22  |  2KB  |  45 lines

  1. /*
  2. IXWeightingDomain.h
  3. Copyright 1991, NeXT Computer, Inc.
  4. */
  5.  
  6. #import    <objc/Object.h>
  7.  
  8. @class IXAttributeParser;
  9.  
  10. @interface IXWeightingDomain: Object
  11. {
  12.     unsigned    beenRanked; // true when tokens have been ranked
  13.     unsigned    totalTokens; // the record of tokens in sample
  14.     unsigned    uniqueTokens; // record of unique tokens in sample
  15.     unsigned    indexCount; // record of entries in token index
  16.     unsigned    totalLength; // the sum of all the token lengths
  17.     void    *tokenArray; // "lexeme rank count lexeme rank count..."
  18.     unsigned    *tokenIndex; // array of offsets into token array
  19. }
  20.  
  21. - initFromDomain:(NXStream *)stream; // reads domain format
  22. - writeDomain:(NXStream *)stream; // write domain format
  23.  
  24. - initFromHistogram:(NXStream *)stream; // reads histogram format
  25. - writeHistogram:(NXStream *)stream; // writes histogram format
  26.  
  27. - initFromWFTable:(NXStream *)stream; // reads WFTable format
  28. - initFromAttributeParser:(IXAttributeParser *)aParser;
  29.  
  30. - (unsigned)totalTokens; // how many tokens were seen by parser
  31. - (unsigned)uniqueTokens; // how many unique tokens were found by parser
  32.  
  33. - (unsigned)countForToken:(void *)token // how many times did token occur
  34.     ofLength:(unsigned)aLength;
  35. - (unsigned)rankForToken:(void *)token // rank token against the others
  36.     ofLength:(unsigned)aLength;
  37.  
  38. - (float)frequencyOfToken:(void *)token // ratio token count to total count
  39.     ofLength:(unsigned)aLength;
  40. - (float)peculiarityOfToken:(void *)token // frequency relative to domain
  41.     ofLength:(unsigned)aLength andFrequency:(float)frequency;
  42.  
  43. @end
  44.  
  45.