SQLTeam.com | Weblogs | Forums

How to generate concordance


urgent help please...this is killing me i need a solution.

i appreciate any help in advance

Generate a Concordance

Given an arbitrary text document written in English, write a program that will generate a concordance, i.e. an alphabetical list of all word occurrences, labeled with word frequencies. Bonus: label each word with the sentence numbers in which each occurrence appeared.

Sample Output:
a. a {2:1,1}
b. all {1:1}
c. alphabetical {1:1}
d. an {2:1,1}
e. appeared {1:2}
f. arbitrary {1:1}
g. bonus {1:2}
h. concordance {1:1}
i. document {1:1}
j. each {2:2,2}
k. english {1:1}
l. frequencies {1:1}
m. generate {1:1}
n. given {1:1}
o. i.e {1:1}
p. in {2:1,2}
q. label {1:2}
r. labeled {1:1}
s. list {1:1}
t. numbers {1:2}
u. occurrence {1:2}
v. occurrences {1:1}
w. of {1:1}
x. program {1:1}
y. sentence {1:2}
z. text {1:1}
aa. that {1:1}
bb. the {1:2}
cc. which {1:2}
dd. will {1:1}
ee. with {2:1,2}
ff. word {3:1,1,2}
gg. write {1:1}
hh. written {1:1}


"write a program" - sounds like you are supposed to create an application to handle it. SQLTeam.com is for Microsoft SQL Server. While it can be done in T-SQL, that's not what your instructor is asking you to do, if I'm reading it right.