PhonologicalCorpusTools / CorpusTools

Phonological CorpusTools
http://phonologicalcorpustools.github.io/CorpusTools/
GNU General Public License v3.0
111 stars 16 forks source link

[BUG] Functional Load on corpus with non-canonical column names #790

Closed stannam closed 2 years ago

stannam commented 2 years ago

Describe the bug If a corpus has non-canonical column names, functional load crashes.

Sample corpus file copy-paste the following as a txt file and load it on PCT

col1,col2,col3,col4 abc,ətʃəɹ,A,1 ac,ɪsstʃəɹ,B,10 ab,təʃə,A,100 bc,sətʃəɹ,B,10000

To Reproduce

  1. Import the text file.

  2. Use strange names for the columns In the following example I used S for spelling, C for category and F for frequency. image

  3. Load corpus and run FL

  4. PCT crashes

Expected behavior Functional load should work.

Screenshots This is the error message.

Traceback (most recent call last): File "D:\PycharmProjects\CorpusTools\corpustools\gui\flgui.py", line 39, in run self.results = FL.minpair_fl_speed(c, pairs, **kwargs) File "D:\PycharmProjects\CorpusTools\corpustools\funcload\functional_load.py", line 295, in minpair_fl_speed word = (w.Spelling, getattr(w, corpus_context.sequence_type), w.Frequency) AttributeError: 'Word' object has no attribute 'Spelling'

Operating system and PCT version

Additional context