*
* @throws MaltChainedException
*/
public void update() throws MaltChainedException {
// Retrieve the address value
final AddressValue arg1 = addressFunction1.getAddressValue();
final AddressValue arg2 = addressFunction2.getAddressValue();
// featureValue.setKnown(true);
// if arg1 or arg2 is null, then set a NO_NODE null value as feature value
if (arg1.getAddress() == null || arg2.getAddress() == null) {
featureValue.setIndexCode(table.getNullValueCode(NullValueId.NO_NODE));
featureValue.setSymbol(table.getNullValueSymbol(NullValueId.NO_NODE));
featureValue.setValue(1);
featureValue.setNullValue(true);
} else {
// Unfortunately this method takes a lot of time arg1.getAddressClass().asSubclass(org.maltparser.core.syntaxgraph.node.DependencyNode.class);
// Cast the address arguments to dependency nodes
final DependencyNode node1 = (DependencyNode)arg1.getAddress();
final DependencyNode node2 = (DependencyNode)arg2.getAddress();
if (!node1.isRoot() && !node2.isRoot()) {
// Calculates the distance
final int index1 = node1.getIndex();
final int index2 = node2.getIndex();