Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ wftable(3) — NEXTSTEP 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

text(3)

wfcomp(1)

WFTABLE(3)  —  UNIX Programmer’s Manual

NAME

wftable - word frequency table functions

SYNOPSIS

#include <text/wftable.h>

DESCRIPTION

These functions support textual analysis using a data structure called a WFTable. They are part of the text library, libtext.  The link editor searches this library under the "-ltext" option.  Declarations for these functions may be obtained either from the include file <text/wftable.h>, or from the master include file <text/text.h>. 
 

SUMMARY

char ∗ isFunctionWord(char ∗s)

True if s is a common English function word (e.g., “the”, “and”, “or”; case-insensitive). 

double wordPeculiarity(char ∗s, double count, double total, WFTable ∗table)

Returns the index of peculiarity of s relative to table.  This is the ratio of its frequency in the source (count/total) to its frequency in the base domain described by table. 

float wordFrequency(char ∗word, WFTable ∗table)

Returns the frequency of word in table. 

unsigned long wordCount(char ∗word, WFTable ∗table)

Returns the number of occurrences of word in table table, or 0 if it never occurs. 

unsigned long wordRank(char ∗word, WFTable ∗table)

Returns the unary-origin rank of word in table table, or 0 if it never occurs. 

unsigned long wordStat(char ∗word, WFTable ∗table, long ∗rank)

Returns the number of occurrences of word in table, or 0 if it never occurs.  Put the rank of word (if any) in rank. 

WFTable ∗ DefaultLanguageWFTable()

Returns the default language frequency table (computer english sampled from novels, dictionaries, computer mail, text files, newswires, and on-line documentation). 

WFTable ∗ makeWFTableFromHistogram(char ∗file, FILE ∗fp)

Makes a hashed WFtable from file.  file (or fp) is a word histogram file containing lines of the following form:

word count
...

char ∗ findWFTable(char ∗file)

Looks for the WFTable called file.  If file is accessible as given, returns file; otherwise looks for file or file.wf in the index area. 

WFTable ∗ readWFTable(char ∗file)

file (or fp) is a WFTable data file .  Loads and returns the archived WFtable file, as created by writeWFTable(), or NULL if there was a problem. 

void writeWFTable(WFTable ∗table, char ∗file)

Archives the WFTable table by writing it to file.  table can be reread from file using readWFTable(). 

void freeWFTable(WFTable ∗table)

Frees the storage associated with table. 

SEE ALSO

text(3), wfcomp(1)

NeXT, Inc.  —  July 7, 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026