$('#morphology').empty();
$.each( lexlist, function( idx, lex ) {
var morphoptions = [];
- $.each( lex['wordform_matchlist'], function( tdx, tag ) {
- var tagstr = stringify_wordform( tag );
- morphoptions.push( tagstr );
- });
+ if( 'wordform_matchlist' in lex ) {
+ $.each( lex['wordform_matchlist'], function( tdx, tag ) {
+ var tagstr = stringify_wordform( tag );
+ morphoptions.push( tagstr );
+ });
+ }
var formtag = 'morphology_' + idx;
var formstr = '';
- if( lex['form'] ) {
+ if( 'form' in lex ) {
formstr = stringify_wordform( lex['form'] );
}
var form_morph_elements = morph_elements(
}
function stringify_wordform ( tag ) {
- var elements = tag.split(' // ');
- return elements[1] + ' // ' + elements[2];
+ if( tag ) {
+ var elements = tag.split(' // ');
+ return elements[1] + ' // ' + elements[2];
+ }
+ return ''
}
function morph_elements ( formtag, formtxt, currform, morphoptions ) {