#!/usr/bin/env python
# coding: utf-8
# # Swapping of wordorders in XML source files (N1904LFT)
# ## Table of content
# * 1 - Introduction
# * 2 - Load Text-Fabric app and data
# * 3 - Performing the queries
# * 3.1 - Swaps in wordorder
# # 1 - Introduction
# ##### [Back to TOC](#TOC)
#
# This notebook investigate the occurence of wordorder changes in the XML source files.
# # 2 - Load Text-Fabric app and data
# ##### [Back to TOC](#TOC)
# In[1]:
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
# In[2]:
# Loading the Text-Fabric code
# Note: it is assumed Text-Fabric is installed in your environment
from tf.fabric import Fabric
from tf.app import use
# In[3]:
# load the N1904 app and data
N1904 = use ("tonyjurg/Nestle1904LFT", version="0.6", hoist=globals())
# In[4]:
# The following will push the Text-Fabric stylesheet to this notebook (to facilitate proper display with notebook viewer)
N1904.dh(N1904.getCss())
# # 3 - Performing the queries
# ## 3.1 - Swaps in wordorder
# ##### [Back to TOC](#TOC)
# Differences in wordorder between TF and XML source data
# In[65]:
#range:
#print (F.otype.sInterval("word"))
for node in F.otype.s("word"):
monad=F.monad.v(node)
orig_order=F.orig_order.v(node)
# too bad... it is not in the dataset anymore :( -> needs to be added in next release again
if monad != orig_order:
print (node)
# In[ ]: