Jump to content

Seeking data-structure suggestions


PCode
 Share

Recommended Posts

Basically I want to sort data into a treeview. Ideally it would look something like this

Essay
-Paragraph 1
--Sentence 1
---Word 1
---Word 2
---Word 3
--Sentence 2
---Word 1
---Word 2
---Word 3
---Word 4
-Paragraph 2
...

I think that should give you the picture. The number of paragraphs in an essay, sentences in a paragraph, and words in a sentence however are unknown.

One thing I've considered is a multidimensional array, but wouldn't I have to have every sentence store the same amount of words as the sentence with the highest amount of words?

I've also considered arrays of arrays, but wouldn't I have a create a dummy array every time I wanted to go a dimension further into the array?

So either correct me if I'm mistaken, suggest a better way of storing this data, or tell me that I'm just between a rock and a hard space.

Edited by PCode
Link to comment
Share on other sites

Sounds like an XML file would do nicely. Have you any experience with _XMLDOMWrapper.au3 UDF or XPath syntax?

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I once used this code to populate a Treeview.

Every line starts with a #. The number of spaces denote the level in the tree. No space = top level, 1 space = child of top level etc.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...