Note that there are some explanatory texts on larger screens.

plurals
  1. PODistributed updating of object collections
    primarykey
    data
    text
    <p>My objects structure in a current program is organized so that a <code>Doc</code> object contains a list of <code>Mention</code> objects, and each <code>Mention</code> object contains a list of <code>Word</code> objects. Words are identified by their position in the Doc's text and also store some other information (its text, its wordnet sense...)</p> <p>In the processing of the program (through user interaction, etc..) <code>Word</code> objects inside a <code>Mention</code> can be accessed and modified value (for example, update its sense). User interaction with each <code>Mention</code> is a requirement.</p> <p>The problem I met here is that several <code>Mention</code>s that belong to the same <code>Doc</code> might share some same <code>Word</code>s (after all, all words are in the Doc). So when such a Word is updated, how should I update the corresponding <code>Word</code> contained in other <code>Mention</code>s ? In other words, these <code>Word</code>s are in the same exact location in the text and should be updated together, but they are stored separately in Mentions. So how should one update change the others ?</p> <p>One approach I used is when a <code>Word</code> inside a <code>Mention</code> is modified, I retrieve all mentions (from a stored <code>Doc</code> reference) and then update the corresponding <code>Word</code> in any <code>Mention</code> that contains it. This requires a for loop with Equals checks on each update, which is quite a lot processing. </p> <p>The second approach I think of is not to store separate <code>Word</code> lists in <code>Mention</code>s. Only a single list of <code>Word</code>s is store in <code>Doc</code>, and in each <code>Mention</code> the indices of which <code>Word</code>s belong to the <code>Mention</code> is store in a list. So when updating a <code>Word</code>, I will call an update function from the <code>Doc</code>'s reference to update the <code>Doc</code>'s list. However, the problem lies in the function that returns the whole list of <code>Word</code>s for a <code>Mention</code>. I have to return a new list of <code>Word</code>s, using the indices I have to pick actual <code>Word</code>s inside the <code>Doc</code>'s list. This is needed because all <code>Word</code>s inside that <code>Mention</code> may have been modified by some other <code>Mention</code>(s) just shortly before. Alternatively, I can check if a <code>Word</code> is updated and copy the update. But it still requires a for loop through all <code>Word</code>s in the <code>Mention</code>, so it still seems weird (Each time retrieving the list = long operation)</p> <p>What I want to ask is if there is any better solution to this update problem. Any help is much appreciated :) If it is necessary, I will add part of my code here.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload