Skip to content

Commit

Permalink
made into a module
Browse files Browse the repository at this point in the history
  • Loading branch information
elipapa committed Dec 6, 2014
1 parent ea8da15 commit 0699b22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions __init__.py
@@ -0,0 +1 @@
from karmen.karmen import *
6 changes: 4 additions & 2 deletions karmen.py
Expand Up @@ -32,13 +32,15 @@


import sys
import os
from lxml import etree
import argparse
import re
from collections import deque

# Parse tree
langual = etree.parse('LanguaL2013.XML')
langual_file = os.path.join(os.path.dirname(__file__), 'LanguaL2013.XML')
langual = etree.parse(langual_file)
"""
the tree structure is not represented as XML hierarchy. each descriptor is at the same leve. The hierarchy is coded using parents IDs:
FTC is the node ID
Expand Down Expand Up @@ -136,7 +138,7 @@ def find_descendants(xmlelements, langualtree = langual):
"""

#TODO must speed this up! though most of the time is spent
# on the .iter lxml function, so there may not be much more
# on the .iter lxml function, so there may not be much more room

queue = deque(xmlelements)
desc = xmlelements #Notice the returned list also includes the given root.
Expand Down

0 comments on commit 0699b22

Please sign in to comment.