Python Forum
How to calculate the lexical diversity average (with 1000 window word length)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to calculate the lexical diversity average (with 1000 window word length)
#5
I'm a bit confused with the terminology used, tokens, windows words, slices of letters....
But this is what i did: I created a mock text, in this case 3000 string numbers, so it is easy to see the overlap.
And then sliced it up into 999 letter segments, based on what i proposed in post # 2.
Instead of printing the segment, do your calculations on it.
Hope this helps.
Paul

totalText = ''
for x in range(3000):
    totalText += str(x) + ' '

for x in range(0,len(totalText),500):
    slice = totalText[x:x+999]
    print(f'Slice length: {len(slice)}')
    print(slice)
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Messages In This Thread
RE: How to calculate the lexical diversity average (with 1000 window word length) - by DPaul - Jul-26-2020, 07:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple Method to calculate average and grade ajitnayak1987 8 10,031 Apr-28-2022, 06:26 AM
Last Post: rayansaqer

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020