What's the definition of a long word: simply the number of letters in it?
Assuming you're using Access 2000 or newer, you can use the Split function
to break each sentence into its individual words, then calculate the length
of each word. Something like the following untested aircode (it assumes that
the entire paragraph is stored in strFile):
Dim lngCountLongWords As Long
Dim lngCountWords As Long
Dim lngSentence As Long
Dim lngWords As Long
Dim strFile As String
Dim varSentences As Variant
Dim varWords As Variant
varSentences = Split(strFile, ".")
If IsNull(varSentences) = False Then
For lngSentence = LBound(varSentences) To UBound(varSentences)
' Extra spaces and the like may result in some elements in
' varSentences not actually being true sentences. For example,
' if there are 2 blanks in a row, you'll end up with an empty element
' in varSentences. You can vary the limit here if you like...
If Len(varSentences(lngSentence) > 0 Then
varWords = Split(varSentences(lngSentence), " ")
If IsNull(varWords) = False Then
For lngWord = LBound(varWords) To UBound(varWords)
If Len(varWords(lngWord)) > 0 Then
lngCountWords = lngCountWords + 1
' You'll likely want to vary this number too
If Len(varWords(lngWord)) > 9 Then
lngCountLongWords = lngCountLongWords + 1
End If
End If
Next lngWord
End If
End If
Next lngSentence
End If
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"achristoffersen" <ac*************@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
For my thesis I'm using access to analyze news-articles. I would like
to calculate readability score. But I don't know how.
I have a very simple word count already, and I also have an
approximation of whole sentences (number of periods "."). If this group
can help me count how many occurrences of long words there is in an
article, I can calculate the Danish LIX.
A long word is defined as longer than 7 letters.
Thank you in advance