![]() Both operations change the text in the text stimulus, which created a circular situation when needing to monitor whether the text had been altered in the `.text()` function. It wasn't feasible to allow these settings to be adjusted after the TextStim has been initialised. Farsi examples have been added to the Coder `textStimuli.py` demo. Without applying this re-shaping, characters are instead shown in their 'isolated' form. The characters need to flow into each other, so each character's shape depends on its neighbours. Arabic (and other languages like Farsi that use much the same script) have an additional need. This should be sufficient to display Hebrew properly, for example. RTL fixes the left-to-right display of what should be right-to-left text by applying the bidirectional algorithm. These capacities rely on the `bidi` and `arabic_reshaper` packages. That parameter has also now been exposed via the Builder Text component Settled on adding a single 'languageStyle' parameter in the TextStim initialisation, with options 'LTR', 'RTL', or 'Arabic', instead of two boolean parameters (`bidirectional` and `arabicReshape`). # to reshape Arabic characters from their isolated form:īegin routine: reshaped_text = arabic_reshaper.reshape(original_text) # reshape charactersįinal_text = algorithm.get_display(reshaped_text) # change to right-to-left If you get that to work, then the code I used was this:īegin experiment: # library for displaying right-to-left text correctly: Until we bundle the package, you’ll need to follow the instructions for that process here: If, however, like most people, you’re using a standalone PsychoPy distribution, accessing additional packages is more complicated. If using one’s own Python, installing a package like this is as simple as typing pip install arabic-reshaper in a terminal. I ran the example above using PsychoPy within my own Anaconda Python 3 installation, not using the standalone PsychoPy application. We would allow them to be applied independently, as I think Hebrew users for example only need the bidirectional algorithm, whereas, as you’ve shown, languages using the Arabic alphabet need the reshaping as well.īut you don’t need to wait for that development, and can just use the functions directly, just as you’ve already done in IDLE. Once that package is available, it would then become very easy to actually add its functionality (and the bidirectional algorithm) to PsychoPy’s text stimulus, and ideally make it available via the graphical text component in Builder as well. ![]() The best solution would be to bundle the arabic-reshaper package with the standalone PsychoPy distributions, so that all users get access to its functions as required. ![]() ![]() My laptop is a Macbook pro (2015) with OSx Mojave 10.14.4.Hi Omid, thanks for your work and independent confirmation. I understand that my questions are probably too simple or obvious for most of you, but I am still a bit new using the terminal and some coding languages. So that seems to indicate that I had two different copies of Psychopy in my computer, one that corresponded to the deleted file and other which might be the libraries in my anaconda folders.ġ Do these (standalone file and psychopy scripts) psychopy copies are independent versions?Ģ How can I check what is the psychopy version that I am actually using?ģ Do I need the standalone psychopy (the file) in order to use the builder?Ĥ What it is the proper way to complete uninstall all the previous versions of psychopy from my computer? (I could not find this information in the forum/documentation) Believing that psychopy was uninstalled from my computer I moved back to spyder and I tried to lunch the psychopy experiment and it worked, probing that I was wrong and psychopy is still installed. I have recently deleted the Psychopy standalone file from the Applications folder. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |