Forum Archive

Braille application.

shinya.ta

I am thinking of an application to input text using Braille.

I'm thinking about Braille in Japanese.

Is it possible for Pythonisa?

JonB

Have you looked at the built in braile input?

https://support.apple.com/guide/iphone/type-onscreen-braille-using-voiceover-iph10366cc30/ios

cvp

@shinya.ta Does the iOS standard Braille also support Japanese Braille like Wikipedia?

If not, do you want to entirely write yourself a script to allow Japanese Braille input in Pythonista? If this is the case, could you describe how you imagine that?

cvp

@shinya.ta Please, try this, with these remarks:
- I really don't know nor Japonese, nor Braille, thus...
- this script is obviously quick and dirty, only to show what is possible
- positions of the 6 buttons could be parametrized for each user
1 4
2 5
3 6
- standard keyboard could be removed or replaced by some keys (left delete...)
- I only can test on iPad, sorry if not works on iPhone
- the script needs Gestures of @mikael, our Ukko Ylijumala from Finland ๐Ÿ˜€
- use of 3 fingers needs you disable Settings/General/Accessibilty/Zoom
- it only supports a few points combinations for testing
but you can easily add other ones

    Japanese_Braille = {
        '1':'ใ‚',
        '12':'ใ„',
        '14':'ใ†',
        '124':'ใˆ',
        '24':'ใŠ',
        '16':'ใ‹',
        '1246':'ใ‘'
        }
  • I'm ready do continue the script development, with your requests, but at my speed and availability
import ui
from objc_util import *
from Gestures import Gestures

def SetTextFieldPad(tf, pad=None, clearButtonMode=False, undo_redo_pasteBarButtons=False, textfield_did_change=None):
    if not pad:
        pad = [
        {'key':'1','x':2,'y':1},
        {'key':'2','x':2,'y':2},
        {'key':'3','x':2,'y':3},
        {'key':'4','x':5,'y':1},
        {'key':'5','x':5,'y':2},
        {'key':'6','x':5,'y':3},

        ]
    Japanese_Braille = {
        '1':'ใ‚',
        '12':'ใ„',
        '14':'ใ†',
        '124':'ใˆ',
        '24':'ใŠ',
        '16':'ใ‹',
        '1246':'ใ‘'
        }
    tfo = ObjCInstance(tf).textField() # UITextField is subview of ui.TextField

    def key_pressed(key):
            if key not in Japanese_Braille:
                return
            ch = Japanese_Braille[key]
            cursor = tfo.offsetFromPosition_toPosition_(tfo.beginningOfDocument(), tfo.selectedTextRange().start())
            tf.text = tf.text[:cursor] + ch + tf.text[cursor:]
            cursor = cursor + 1

            if textfield_did_change:
                textfield_did_change(tfb)

            # set cursor
            cursor_position = tfo.positionFromPosition_offset_(tfo.beginningOfDocument(), cursor)
            tfo.selectedTextRange = tfo.textRangeFromPosition_toPosition_(cursor_position, cursor_position)

    def tapped(data):
        #print('tapped',data.number_of_touches)
        #print(len(data.recognizer.touches()))
        bs = []
        for t in data.recognizer.touches():
            pt = t.locationInView_(ObjCInstance(v))
            for b in v.subviews:
                r = b.width/2
                x = b.x + r
                y = b.y + r
                if ((pt.x-x)**2+(pt.y-y)**2) <= r**2:
                    # touch in circle of button
                    if b.name not in bs:
                        # avoid two times same button
                        bs.append(b.name)
        if len(bs) != data.number_of_touches:
            # at least one touch outside buttons, no way to recognize
            return
        seq = ''
        for b in sorted(bs):
            seq = seq + b
        key_pressed(seq)

    # design your keyboard

    v = ui.View()
    v.border_color = 'red'
    v.border_width = 4
    w,h = ui.get_screen_size()
    h = h - 350
    db = w/6 
    dd = (h-3*db)/4
    y_max = 0

    for pad_elem in pad:
        b = ui.Button()
        b.name = pad_elem['key']
        b.background_color = (1,0,0,0.5)
        b.tint_color = 'red'
        b.font = ('Academy Engraved LET',36)
        b.corner_radius = db/2
        b.title = b.name
        x = (pad_elem['x']-1)*db
        y = dd + (pad_elem['y']-1)*(db+dd)
        b.frame = (x,y,db,db)
        b.TextField = tf # store tf as key attribute  needed when pressed
        b.enabled = False
        v.add_subview(b)
        y_max = max(y_max,y+db+dd)

    v.width = ui.get_screen_size()[0]
    v.height = h
    g = Gestures()
    for n in range(1,7):
        g.add_tap(v, tapped,number_of_touches_required=n)

    # view of keyboard
    retain_global(v) # see https://forum.omz-software.com/topic/4653/button-action-not-called-when-view-is-added-to-native-view
    tfo.setInputAccessoryView_(ObjCInstance(v)) # attach accessory to textview
    #print(dir(tfo))

if __name__ == '__main__':      
    import ui 
    tf = ui.TextField()
    SetTextFieldPad(tf)
    tf.text = ''
    tf.width = 200
    tf.name = 'Japanese Braille'
    tf.present('sheet')
    tf.begin_editing()
    tf.wait_modal()

cvp

Special gestures can also be added like in standard IOS Braille.
For example, here-after:
- swipe from right to left to back space, delete at left
- swipe from left to right to add a space
- swipe from bottom to top with 3 fingers to return and dismiss the keyboard

Sorry to post two similar scripts so, next time, if any, I would post it on GitHub

import ui
from objc_util import *
from Gestures import Gestures

def SetTextFieldPad(tf, pad=None, clearButtonMode=False, undo_redo_pasteBarButtons=False, textfield_did_change=None):
    if not pad:
        pad = [
        {'key':'1','x':2,'y':1},
        {'key':'2','x':2,'y':2},
        {'key':'3','x':2,'y':3},
        {'key':'4','x':5,'y':1},
        {'key':'5','x':5,'y':2},
        {'key':'6','x':5,'y':3},

        ]
    Japanese_Braille = {
        '1':'ใ‚',
        '12':'ใ„',
        '14':'ใ†',
        '124':'ใˆ',
        '24':'ใŠ',
        '16':'ใ‹',
        '1246':'ใ‘'
        }
    tfo = ObjCInstance(tf).textField() # UITextField is subview of ui.TextField

    def key_pressed(key):
            cursor = tfo.offsetFromPosition_toPosition_(tfo.beginningOfDocument(), tfo.selectedTextRange().start())
            if key == 'back space':
                if cursor > 0:
                    #if tfb.text != '':
                    tf.text = tf.text[:cursor-1] + tf.text[cursor:]
                    cursor = cursor - 1
            elif key == 'return':
                tf.end_editing()
                return
            elif key == ' ':
                ch = ' '
                tf.text = tf.text[:cursor] + ch + tf.text[cursor:]
                cursor = cursor + 1
            elif key not in Japanese_Braille:
                return
            else:
                ch = Japanese_Braille[key]
                tf.text = tf.text[:cursor] + ch + tf.text[cursor:]
                cursor = cursor + 1

            if textfield_did_change:
                textfield_did_change(tfb)

            # set cursor
            cursor_position = tfo.positionFromPosition_offset_(tfo.beginningOfDocument(), cursor)
            tfo.selectedTextRange = tfo.textRangeFromPosition_toPosition_(cursor_position, cursor_position)

    def tapped(data):
        #print('tapped',data.number_of_touches)
        #print(len(data.recognizer.touches()))
        bs = []
        for t in data.recognizer.touches():
            pt = t.locationInView_(ObjCInstance(v))
            for b in v.subviews:
                r = b.width/2
                x = b.x + r
                y = b.y + r
                if ((pt.x-x)**2+(pt.y-y)**2) <= r**2:
                    # touch in circle of button
                    if b.name not in bs:
                        # avoid two times same button
                        bs.append(b.name)
        if len(bs) != data.number_of_touches:
            # at least one touch outside buttons, no way to recognize
            return
        seq = ''
        for b in sorted(bs):
            seq = seq + b
        key_pressed(seq)

    # like IOS left swipe: delete at left       
    def left_swipe_handler(data):
        key_pressed('back space')

    # like IOS right swipe: space       
    def right_swipe_handler(data):
        key_pressed(' ')

    # like IOS up swipe with 3 fingers: return
    def up_swipe_handler(data):
        key_pressed('return')

    # design your keyboard

    v = ui.View()
    v.border_color = 'red'
    v.border_width = 4
    w,h = ui.get_screen_size()
    h = h - 350
    db = w/6 
    dd = (h-3*db)/4
    y_max = 0

    for pad_elem in pad:
        b = ui.Button()
        b.name = pad_elem['key']
        b.background_color = (1,0,0,0.5)
        b.tint_color = 'red'
        b.font = ('Academy Engraved LET',36)
        b.corner_radius = db/2
        b.title = b.name
        x = (pad_elem['x']-1)*db
        y = dd + (pad_elem['y']-1)*(db+dd)
        b.frame = (x,y,db,db)
        b.TextField = tf # store tf as key attribute  needed when pressed
        b.enabled = False
        v.add_subview(b)
        y_max = max(y_max,y+db+dd)

    v.width = ui.get_screen_size()[0]
    v.height = h
    g = Gestures()
    for n in range(1,7):
        g.add_tap(v, tapped,number_of_touches_required=n)
    g.add_swipe(v, left_swipe_handler, direction = Gestures.LEFT)
    g.add_swipe(v, right_swipe_handler, direction = Gestures.RIGHT)
    g.add_swipe(v, up_swipe_handler, direction = Gestures.UP, number_of_touches_required=3)

    # view of keyboard
    retain_global(v) # see https://forum.omz-software.com/topic/4653/button-action-not-called-when-view-is-added-to-native-view
    tfo.setInputAccessoryView_(ObjCInstance(v)) # attach accessory to textview
    #print(dir(tfo))

if __name__ == '__main__':      
    import ui 
    tf = ui.TextField()
    SetTextFieldPad(tf)
    tf.text = ''
    tf.width = 200
    tf.name = 'Japanese Braille'
    tf.present('sheet')
    tf.begin_editing()
    tf.wait_modal()
cvp

Version without standard keyboard is Braille_Input.py

Don't forget to swipe with 3 fingers from bottom to top to dismiss the (Braille) keyboard

shinya.ta

@JonB

My wife is having trouble using the rotor function, so I've been thinking about a special application.

shinya.ta

@cvp

Dear.cvp

I tried on my iPhone, but the third line of the ModuleNotFoundError comes out.

cvp

@shinya.ta It uses a module that you have to import and copy in your site-packages folder: Gestures

cvp

@shinya.ta Other version here

  • version without Gestures module (see here-after for the reason)
  • while at least one finger stays on screen, another one may "arrive"
  • move of fingers allowed, not only a tap
  • character only added when all fingers leave the screen

  • speech of added character could be programmed but does not work actually

  • special sound could be played when a finger arrives or leave a circle
  • position of circles could be changed and stored per device and orientation
  • ... waiting for your requests
cvp

@shinya.ta The GitHub BrailleInput2.py now supports
- put 6 fingers on the screen and move them to position the circles where you want.
- you may move until all fingers leave the screen
- the positions will be automatically saved in keychain memory of your device, for the current orientation, either portrait, either landscape.
- the saved positions will be reused at next run

That will say that, actually, the character using the 6 dots is not supported. In a close future, I'll try to distinguish between this operation and the 6 dots character.

I'm still waiting for some feedback from you, even very negative if I didn't understand how your wife could use it.

cvp

@shinya.ta Six dots character (ใ‚) also supported now.
Setting of the circles positions needs to put six fingers on the screen, where you want, during at least 3 seconds.
The six dots character needs 6 fingers in the circles, during less than 3 seconds.

Of course, if this way to process is unusable, let me know how to do.

shinya.ta

@cvp

Dear.cvp

I tried a new version.
Another problem has come up.
The application cannot be shut down.

That's why you can't open any other Pythonisa apps.

What should I do?

cvp

@shinya.ta As I said previously, you have to swipe 3 fingers up to close the keyboard.
And after, the x button is available to close the script.

But, first, use of 3 fingers needs you disable Settings/General/Accessibilty/Zoom.

Edit: if you prefer another gesture, let me know, but this is the standard IOS Braille gesture to simulate a return key, thus dismiss the keyboard.

shinya.ta

@cvp

My wife is used to closing buttons.

cvp

@shinya.ta Yes, but in the Braille keyboard with only 6 circles, where do you want to put a close button, and you want that this button dismisses the keyboard, please confirm!

And, please, don't forget that this script is only a starting point to show what could be done.
You have to do your job also ๐Ÿ˜€, that will say explain your requests.
My little script creates a code for any TextField. I don't know how or where you want to use this kind of Braille keyboard.

cvp

@shinya.ta Just added a "close keyboard button" in the GitHub version BrailleInput2.py

Don't hesitate to ask any change but don't hope a quick answer today.
Easter Monday is a bank holiday in Belgium and all my children and grandchildren come for the lunch ๐Ÿพ

shinya.ta

@cvp

Dear.cvp

I'll ask my wife to use it on the weekend.

cvp

@shinya.ta new version:
- rename module into BrailleKeyboardForTextField.py
- rename some functions and classes
- define all characters in Japanese Braille dictionnary with comment showing dots, like:

        '156':'ใ•',      # โ ฑ
        '1256':'ใ—',     # โ ณ
        '1456':'ใ™',     # โ น
        '12456':'ใ›',    # โ ป
        '2456':'ใ',     # โ บ
  • displaying tapped dots, dots symbol and character outside TextField name
cvp

@shinya.ta No news, good news?

shinya.ta

@cvp

Dear.cvp
Sorry for the delay.
I have a long consecutive holiday in Japan now, so I had a family service.

It's a wonderful finish.

There are several problems.

I want the delete button and the Chinese character conversion button.
Because there are many people who don't have disabilities to watch emails.

This time, I'm going to use it for iPhone.

โ€˜ใ‚โ€™
For example, can I input 1.2.3.4.5.6 with one hand?

But.โ€™ใ‚โ€™
I'd like to input it so that I can input only one.

Do you understand it in my poor English?

shinya.ta

@cvp

โ†‘
The sentence was mistaken for some.
It means Kanji in Japanese.

shinya.ta

@cvp

The meaning of the last sentence means "Ahhh" in Japanese, meaning "1".

shinya.ta

@cvp

For example, how about a decision button and a conversion button?

cvp

@shinya.ta Hi, I'm really and sincerely sorry, but I don't understand any question...
I agree to help you for each new request but you will have to explain it in another way.

For example, you speak about delete button, decision button and conversion button.
Are these buttons some combinations of the Braille dots, if yes, which ones, and which process they have to perform? Or are these buttons "normal" buttons, if yes, where to put them and which process?

You speak also about the ใ‚ character which uses the 6 Braille dots and you ask to use one hand, do you have an hand with six fingers? ๐Ÿ˜€It is a joke, sorry. Please explain also.

I wait for your answer, and I'm sorry for the time difference between our two countries.

cvp

@shinya.ta I remember you that, like in Apple standard Braille keyboard, my little script supports:
- left swipe with one finger to delete previous character
- right swipe at right to insert a blank or space

shinya.ta

@cvp

Sorry for poor English.

The standard operation of Apple is difficult to use if you use voiceOver.

Assuming that the iPhone is used vertically, I'd like to request a delete button and a decision button on the bottom side.

"A" is one braille button and it will be displayed soon.
However, with other letters, multiple points are needed, so the device records the point and wants to make a decision operation.

cvp

@shinya.ta Thanks for the explanation but I still have questions:
- delete button = left delete / backspace? (Just to be sure)
- decision button, sorry, I don't understand yet
Do you want to say that the points are not tapped together but one after the other?
And the decision button must be tapped at end of each points set?
- you say that if the character has only one dot, no decision button is needed, but how
The program could distinguish a 1 of a 1-2 for instance?
Is it a maximum delay before the next character?
- and what is the conversion button?

cvp

@shinya.ta a new version is available at GitHub
- left delete button at bottom left
- confirm (decision?) Button at bottom right
the dots buttons stay active until you press this button
. even if all fingers have left the screen
. even if only one dot because an eventual 2nd dot could come

Anyway , please answer to questions of previous post and don't worry if this version is not what you want, I just try to go on with what I understood.
If you want other dimensions, colors, icons, positions and functions for buttons, please let me know.

shinya.ta

@cvp

I tried it.
There are some problems.

ใ‚ใ€ใ„ใ€ใ†ใ€ใˆใ€โ€ฆใ‚’
You can't input in turn.

One more thing, we use Kanji in Japanese.
So, I'd like to make a tentative decision instead of making a decision.
Then, the iPhone will convert the expected conversion.

Then you choose the correct letters and convert them.

Therefore, I want to suppress it by a temporary decision.

The delete button is easier to understand by the name of delete.

shinya.ta

@cvp

The conversion in Japanese is like this.

ใฟใšใ†ใฟโ†’ๆน–
ใ‹ใ‚โ†’ๅท

cvp

@shinya.ta Sorry, I don't understand your explanation. It is not a problem of English language.
I don't understand exactly what my script should do.
I think that I did understand incorrectly at begin, sorry.

Could you give an example of the sequence of what you tap on the screen and how the script should react.

Exeample of what I did understand: I tap dot 1, dot 2, dot ok (at right bottom) and the script inserts ใ„ in the text field...

cvp

@shinya.ta I think that I begin (very slowly) to understand...
Braille dots will generate kinds of syllables (kana) and their combination must be converted in a word (kanji) via a dictionary .

cvp

@shinya.ta It seems that there is also a Braille Kanji

shinya.ta

@cvp

That example is fine.
Yesterday, the reaction of the dot was strange.

Even if I tried to tap all the dots, the response was up to four.

shinya.ta

@cvp

Can you display fifty Japanese syllables in turn on that device?

shinya.ta

@cvp

My wife doesn't remember the Braille of Kanji.
All the visually impaired people do not understand the Braille of the Chinese characters.

Therefore, the conversion of kanji characters is necessary from the input of Hiragana.

cvp

@shinya.ta Hi, this is what I understand:
- there is a bug of some dots forgotten, due to the fact I accept that the dots must be
memorized until the ok button and not until the fingers leave the screen.
the same Touch ID is sometimes generated by Pythonista...
I promise the bug will be solved today
- we will not use the kanji Braille, only the hiragana
- you accept the fact that the user needs to press the ok button after each dots set which
represents a syllable or hiragana
- I don't understand your question about 50 syllables
- How will the hiragana's be converted in one of the 2000 official kanji's?
Do I need to try to find a conversion table, like ใ‹ใ‚โ†’ๅท

shinya.ta

@cvp

I thought that the program doesn't work because of this terminal.
So, I wanted you to try it on your device.

When you start this program with the Bluetooth keyboard while you are starting this program, you will find a list of your prediction without permission.

Even if you use Pythonisa, iPhone makes a list of prediction without permission.

cvp

@shinya.ta I don't have any prediction on my iPad mini 4
Is it possible that you post a screen copy?
Is it a row with predictions at the bottom of the dots?
It is strange because I remove the standard keyboard to display the red dots.
Or I don't understand...

shinya.ta

@cvp

I don't know how to send a screenshot here.

cvp

@shinya.ta Remember, I explained it some months ago here

cvp

@shinya.ta If it is too complicated, try to explain what you do, step by step, before to see this row of predictions...

Sorry, but I have to leave for more than one hour.

shinya.ta

@cvp

import pyimgur,photos,clipboard,os,console
i=photos.pick_image()
print(i.format)
format = 'gif' if (i.format == 'GIF') else 'jpg'
i.save('img.'+format)
clipboard.set(pyimgur.Imgur("303d632d723a549").upload_image('img.'+format, title="Uploaded-Image").link)
console.hud_alert("link copied!")
os.remove('img.'+format)

I don't know how to use this.

shinya.ta

@cvp

Even if you delete the standard keyboard, if you input Japanese, the expected list will come out.

ใ‹ใ‚|
ๅทใ€ๅฏๆ„›ใ„ใ€ใ‚ซใƒฏใ€ๅดใ€้ฉโ€ฆ

โ†‘It comes out without permission like this.

cvp

@shinya.ta to use my little script, you have first to install pyimgur module like explained in the previous link

cvp

@shinya.ta where does this prediction row comes? Just under the red dots?

shinya.ta

@cvp

It will come out just below the text field.
It's a normal function of iPhone.

cvp

@shinya.ta I know that but as you speak about that in this topic, I suppose you get this row with my script only.
Or do you have that in all apps?

If this predictions problem is not relative to my script, could you please, react/answer to my previous post

This is what I understand:
- there is a bug of some dots forgotten, due to the fact I accept that the dots must be
memorized until the ok button and not until the fingers leave the screen.
the same Touch ID is sometimes generated by Pythonista...
I promise the bug will be solved today
- we will not use the kanji Braille, only the hiragana
- you accept the fact that the user needs to press the ok button after each dots set which
represents a syllable or hiragana
- I don't understand your question about 50 syllables
- How will the hiragana's be converted in one of the 2000 official kanji's?
Do I need to try to find a conversion table, like ใ‹ใ‚โ†’ๅท

shinya.ta

@cvp

You need to find a conversion list.

shinya.ta

@cvp

The conversion list will come out in the text input in all the applications.
It is not only the story of Pythonisa.

cvp

@shinya.ta For the predictions problem, you could try a reset of the dictionnary



cvp

@shinya.ta said:

The conversion list will come out in the text input in all the applications.
It is not only the story of Pythonisa.

My script only runs in Pythonista, thus you could not use it in other apps.

shinya.ta

@cvp

https://kanntann.com/flick-input-on-iphone

In Japan, you use the text input on iPhone like this.

cvp

@shinya.ta I understand but if you want to have Braille input, with my script it is on the entire screen but only in Pythonista, with Apple standard Braille, I think it is like my script, and with custom keyboard, it is only in the keyboard at the bottom, not the entire screen.

Please, decide if we go on with my script, that will say entire screen but only in Pythonista.
Of course, we could create a custom keyboard but the 6 dots will be presented in a small part of the screen, in the keyboard area.

shinya.ta

@cvp

On the program of Pythonisra, it appeared just below the text field.
Isn't it possible if there is a button that can be converted after inputting Hiragana in Braille?

cvp

@shinya.ta Your last question is another problem.

Please, let us decide if you accept that:
1) my script runs only in Pythonista
2) my script presents the 6 dots on full screen
3) then, we could TRY to convert the hiragana into Kanji

But, please, confirm an answer to the two first questions

I could try to propose a custom keyboard for all apps but you have to accept that the Braille dots will be presented on a small part of the screen, thus, perhaps unusable for your wife.

shinya.ta

@cvp

My wife can manage full-screen operation with iPhone.
My wife accepts it.

1.2.3. All the ideas are acceptable.

cvp

@shinya.ta I understand that your wife can work with a full-screen Braille keyboard but I asked if she could "type" on a little Braille keyboard at the bottom of the screen, not a full-screen.
If yes, we could create a keyboard usable in all apps...
I'll try to show you an example, in a few hours.

cvp

@shinya.ta With the future new version of Pythonista, you will be able to build custom keyboards which will be usable in all applications with input text.
We could thus present a Braille keyboard like the picture here-under but this one will not be full-screen, perhaps the third of the height of your iPhone. The picture is on my iPad mini 4.
This, I'm not sure this kind of small Braille keyboard is usable by your wife.

shinya.ta

@cvp

Yes.

If it's that type of keyboard, I think you can operate it.

shinya.ta

@cvp

To make it easier for my wife to use it, I think I can change the size and position of buttons by myself.

If it is difficult to change the size, we will review the shape again.

cvp

@shinya.ta Ok, before to go on, you confirm your prefer such a little keyboard usable everywhere than a full-screen keyboard like my initial script but only usable in Pythonista.
Just to be sure, please confirm because the kind of script if entirely different.
And you will need either to wait for the availability of the official new version of Pythonista, either install a beta version.
This kind of script is a custom keyboard extension, very limited in functionalities. I'm not sure we could include all what you want, we will see.

shinya.ta

@cvp

I see.

I'd like a keyboard with this condition until I get a new Pythonisa.

cvp

@shinya.ta Not sure that I have been clear enough, to have this custom keyboard, you need the new Pythonista...

shinya.ta

@cvp

When will the new Pythonisa come out?

cvp

@shinya.ta Only @omz knows it but you can install the beta version of you want.
For that, you have to install the TestFlight Apple app and then go to here

Read this topic first

cvp

@shinya.ta Sorry to insist one more time, understood that your custom keyboard will be something like this on an iPhone, see height of area of red dots.

shinya.ta

@cvp

That image is best.
It exactly matches my image.

cvp

@shinya.ta and you agree you will have a so little area for the six Braille dots?

shinya.ta

@cvp

Yes, I agree.

cvp

@shinya.ta ok
I'll let you go to sleep ๐Ÿ˜€

My next steps are:
- transform my script into a custom keyboard (not so easy)
- debug the problem you met with dots not always taken
- test this first part in an other app than Pythonista, with actually only hiragana
- try to find a way to convert hiragana into kanji

I hope that all this is not too urgent for you, but I'll let you know how the project goes on.

Perhaps, you should install the beta version so you will be able to test when I'll post a first version of this custom keyboard.

cvp

@shinya.ta said:

ใฟใšใ†ใฟโ†’ๆน–
ใ‹ใ‚โ†’ๅท

I try to build a conversion "hiragana into kanji"
To test it, I wanted to use your post
ใฟใšใ†ใฟ -> ๆน–
ใ‹ใ‚ -> ๅท

But my conversion gives

ใฟใšใ†ใฟ -> ๆน– (like you)
ใ‹ใ‚ -> ้ˆน (not like you)

Thus, do I go on?

shinya.ta

@cvp

ใ‹ใ‚โ†’ๅทโ†’River.
Another meaning.
ใ‹ใ‚โ†’็šฎโ†’Skin.

Kanji is difficult.

cvp

@shinya.ta I know that it is difficult but that will say that conversion could be erroneous..
I'll go on and in a few days, I'll post a first version of my script, normally to be used with the new Pythonista version in all apps as custom keyboard but also usable, thus testable, in Pythonista of actual version.
Let me some time please and you will be able to test it your self with your Pythonista version and tell me what I need to correct.

shinya.ta

@cvp

There is no mistake in conversion.
I don't understand the meaning only with hiragana, so many conversion lists appear.

cvp

@shinya.ta I wrote a little conversion script so you could test the way I do it.
It uses a data base of Hiragana to Kanji...from here
Could you try to download this file by
- tapping Download
- options
- Run Pythonista3 script
- Import file

and tell me if the file is arrived in your Documents (root of Pythonista)

cvp

@shinya.ta If you have been able to download the .db file,
please test it with this little script
where you have to type your Hiragana syllables in the TextField, then press return.
You will get the list of Kanji's related to your input.

shinya.ta

@cvp

I'm sorry.

I have never used GitHub, so I don't know how to use the sign-in.

cvp

@shinya.ta I don't think that you need to login

cvp

@shinya.ta

shinya.ta

@cvp

I got a stain on my test.
The conversion is OK, but how should I decide the Kanji that I decided?

cvp

@shinya.ta one step at a time, do not be in a hurry ๐Ÿ˜€
This little script was only to test the conversion.
It is not yet included in my future big script of the keyboard and the selection of the right kanji is not yet programmed.
Wait, wait and (perhaps) see

cvp

@shinya.ta To to go on with my script, I have an important question.

Your wife will
1) tap the Braille dots,
2) tap the ok button and she will get an Hiragana.
3) after some hiragana's, she will tap a conversion button to convert the Hiragana's into a list of possible Kanji's
4) as she is visually impaired, how could she be able to see the Kanji's and select one?

shinya.ta

@cvp

1.2.3. No problem.
4. If you use Voice Over, there should be a detailed description of the letters.

shinya.ta

@cvp

After hearing a detailed description of Voice Over, then tapping the necessary letters.

cvp

@shinya.ta ok, you will test it when I will send you the first version...
Sorry if I'm slow but it not so easy (for me)

cvp

@shinya.ta
This is a first version of Japanese Braille Input.py

This program is still in development, this only to show I really work for you. It has surely a lot of little bugs but that is not very important actually. Please confirm that the general process is what you wait for or not.

It supports to be used as a custom keyboard in any app with TextInput but will need in this case Pythonista 3.3 beta version.

You can also run it in any version of Pythonista for testing purposes. In this case, the script will create a view with only a TextField and will try to simulate a custom keyboard.

The program contains bugs, for sure, I know it but they are well hidden ๐Ÿ˜ข.
Thus, don't be afraid, the script is not yet fully operational and I post it only to allow you perform initial tests.
As the script becomes very complex (at least for me, poor old guy ๐Ÿ‘ด๐Ÿป), I ask you, when you will describe a bug/problem/error to try to give a very detailed description of the problem you met, with an identification number. By example:
E1: "when I press several dots, the first one is sometimes lost"
(known bug, not yet corrected)
If you want to change or add a functionality, do the same. By example:
N1: "please (word not needed), add a delete button also for the Kanji's"
In this case, you have to try to describe where to put this button and how it should work.

Enjoy...and if sufficiently usable, ask your wife to test it also.

What the program already allows, even imperfectly

1) tap some red Braille dots, ex: here 1 and 6
the program shows, in gray, the hirgana and its tapped dots just under

2) to accept it, you press the "ok" button, bottom right

3) the program accepts the hirgana, and shows it in blue the box.
A 'conversion Hirgana to Kanji' button appears at left of Hirgana's

4) You may continue to add some Hirgana's, accept them until you are ready

5) you tap the conversion button

6) you receive the list of possible Kanji's relative to this combination of Hirgana's

7) you select the Kanji you want (I really dont't know to do that if visually impaired)

8) and finally, the selected Kanji is inserted in your TextField

cvp

New version with some corrections

# Version 0.1
# - bug corrected: delete when cursor in TextField shows old Hirganas
# - bug corrected: tap ourside buttons was processed as invalid Braille dots
# - bug corrected: conversion button disappears if conversion gives no Kanji
# - bug corrected: hide conversion buttons if all hirganas deleted
# - bug corrected: back after close (x), closed conversion db error
# - bug corrected: back after close (x), hirganas not cleared
# - bug corrected: ok button was even if dots combination was invalid
# - new: delete button deletes in textfield if no Hirgana in progress
shinya.ta

@cvp

There's an error at three hundred thirty four, and it doesn't work. Why?

shinya.ta

@cvp

I am going out, so I tried it on iPhone.
I understand the error. It's solved.

As I thought, on iPhone, the buttons were displayed only in 1.2.3.

shinya.ta

@cvp

Where do you insert the revised version?

cvp

@shinya.ta Always at the same link, comments show which version you have

From V0.2, I'll invert the versions in the comments above, so the first line will show the version of the script.

cvp

@shinya.ta Which error did you find and how did you solve it? tell me so I'll correct the program

And what is the problem on iPhone ? Are only buttons 123 showed?
Please give an identification to each error, like
E1: buttons 456 not visible on iPhone model ...
I'll correct that today so dimensions will be automatic, promised ๐Ÿ˜”

shinya.ta

@cvp

I didn't know the program download on GitHub, so it was compatible with the copy and paste of the program.

I can't copy all of them, so I copied and paste them in two times.

When the second paste was the first one, there was a space in the front, and there was an error.

I'm sorry, but I made a mistake in typing.

cvp

@shinya.ta you could try to download my little script via copy/paste and then use this script to download bigger ones

use webview to navigate until a Github RAW file to download in Pythonista local files
of course, an url can be pasted in the url TextField
a download button will be enabled and has to be tapped

In a few hours, a new version will be available with automatic positions of Braille dots on all machines in Portrait or Landscape...

shinya.ta

@cvp

The problem of iPhone was only the display of the left side.
That's why the delete button on the left is also displayed.

cvp

@shinya.ta I know, will be corrected in a few hours. Sorry but (very important in Belgium ๐Ÿ˜€) lunch Time now

Did you try to download my download script and did you try to use it to download a bigger script?

cvp

@shinya.ta New version 0.2

# Version 0.2
# - bug corrected: back after close (x), gray hirgana was not cleared
# - bug corrected: TextField not visible on iPhone
# - bug corrected: automatic buttons dimensions and positions for
#                    ipad/iphone portrait/landscape Pythonista/custom keyboard
cvp

@shinya.ta New version 0.3

# Version 0.3
# - new: use keychain to save and restore Braille dots positions
#        service=Braille account=Portrait or Landscape
#        password = '{'dot nยฐ':(x,y),...}'
# - bug corrected: if dots not tapped together, some ones can be lost 
#                  due to reuse by system of same touch_id 
shinya.ta

@cvp

Thank you for the new version.

I'm busy and I don't have time to test.
Please wait for a while to report the test.

cvp

@shinya.ta No problem. I can wait before to see what I did badly ๐Ÿ˜€

shinya.ta

@cvp

I tried version 0.3.

There are some changes.

1.You need to decide only hiragana.
2.It seems easier for my wife to understand the rows of buttons on the same vertical direction as Braille.

cvp

@shinya.ta
1. Do you want to add to the Kanjiโ€™s list the possibility to keep the Hiragana โ€œas isโ€ for the TextField? Please confirm that I did understand your request correctly
2. Donโ€™t forget that a custom
Keyboard has a small height, thus where to put the dots?
a) Like this?
b) Do you want a supplementary button to choose horizontal or vertical dots?

cvp

@shinya.ta New version 0.4

# Version 0.4
# - new: add Hirhana's as 1st element in Kanji's list, in green color
# - new: supports Braille dots buttons 
#                - vertically  : default or argument v
#                - horizontally: argument h
# - new: delete button deletes temporary dots character if in progress
# - bug corrected: delete button during Kanji selection did not hide
#                                    the Kanji's list TableView

To get horizontal dots

shinya.ta

@cvp

1.Please add it.
2.There is a vertical space.
Vertical, please.

cvp

@shinya.ta Already in last version..., if I correctly understood

shinya.ta

@cvp

I took a test.

If it is only hiragana, it is better to decide it as it is, not in the Chinese character list.

cvp

@shinya.ta I'm not sure that I correctly understand.
Do you want to say:

If conversion gives no Kanji, send the Hirgana's directly to the TextField.

Please confirm

cvp

@shinya.ta New Version 0.5

# Version 0.5
# - new: if conversion doesn't give any Kanji, send Hirgana's to TextField
#        without passing via the TextView
cvp

@shinya.ta New version 0.6

# Version 0.6
# - bug corrected: right column of vertical dots had inverted nยฐs

shinya.ta

@cvp

For example, how do you decide if you enter only Hiragana "ใ‚"?

I don't know how to send it to the text field.
The decision button will disappear.

shinya.ta

@cvp

It is another question.
When I chose the beta version, the display size of the previous program has changed.

Does the beta version have the expiration date?

shinya.ta

@cvp

And you can't convert kanji.

โ†‘ โ€ใชใชโ€ โ†’ โ€œไธƒโ€

cvp

@shinya.ta said:

When I chose the beta version, the display size of the previous program has changed.

Does the beta version have the expiration date?

No idea at all.
Did you try to run the program in the Beta version or did you use it as a custom keyboard in another app? In this case, it is normal that size has changed

cvp

@shinya.ta said:

For example, how do you decide if you enter only Hiragana "ใ‚"?

I don't know how to send it to the text field.
The decision button will disappear.

Tap dot 1
Tap โœ… at bottom right
Tap conversion (ๆผขๅญ—) button at left of Hirgana
Select the green ใ‚

And this hirgana is automatically sent to the TextField above

cvp

@shinya.ta said:

And you can't convert kanji.

โ†‘ โ€ใชใชโ€ โ†’ โ€œไธƒโ€

Tap dots 13, then โœ…
Tap dots 13, then โœ…
Tap conversion (ๆผขๅญ—) button
Select ไธƒ and it is done

cvp

@shinya.ta If you want another sequence of taps, please try to give a clear explanation.
I've programmed all with what I did understand and I agree it was perhaps incorrect, due to the fact that English is not our usual language for both of us.

First, confirm that the โœ… button at bottom right is what you call "decision".
For me, it is the "end of dots" for an Hiragana

shinya.ta

@cvp

The size was changed when it used to be used in Pythonisa.

The conversion list doesn't come out.

cvp

@shinya.ta said:

The conversion list doesn't come out.

The conversion list is not visible or do you want it does not come?

cvp

@shinya.ta said:

The size was changed when it used to be used in Pythonisa.

I don't understand this sentence, sorry

shinya.ta

@cvp

"Oprational Error" appears.

cvp

@shinya.ta said:

Oprational Error" appears.

Could you, step by step, explain what you did before to get this error

shinya.ta

@cvp

The size was different when I started the program using the Pythonisa application.

cvp

@shinya.ta said:

The size was different when I started the program using the Pythonisa application.

Do you want to say that since the beta version, the displayed keyboard size is different?
If yes, I really don't know why.

Do you work on the same iPhone?
If no, you could have different size.

cvp

@shinya.ta You can get this *operationalerror* message if the .db file is not present in the same folder as the program

Do you work on the same iPhone?
If no, did you also install HiraganaToKanji.db file?

shinya.ta

@cvp

I probably didn't install "HiraganaToKanji. db".
I'm sorry, but I forgot where I was.

The change of size is the work on the same iPhone.

cvp

@shinya.ta Do you have normal and beta version installed on same iPhone?

shinya.ta

@cvp

Now, the normal one is overwritten and it is only the beta version.

cvp

@shinya.ta Then how HiraganaToKanji. db has disappeared?

shinya.ta

@cvp

import sqlite3
import ui

conn = sqlite3.connect("HiraganaToKanji.db",check_same_thread=False)
cursor = conn.cursor()

v = ui.View()
v.frame = (0,0,400,400)
v.name = 'Test Hiragana_to_Kanji.db'

class MyTextFieldDelegate ():
    def textfield_should_return(textfield):
        cursor.execute(
            'select hiragana, kanji from Hiragana_to_Kanji where hiragana = ?',
            (textfield.text, ))
        t = ''
        for row in cursor:
            t = t + row[1] + '\n'
        textfield.superview['tv'].text = t
        textfield.end_editing()
        return True

tf = ui.TextField()
tf.frame = (10,10,380,32)
tf.delegate = MyTextFieldDelegate
v.add_subview(tf)

tv =ui.TextView(name='tv')
tv.frame = (10,50,380,340)
tv.background_color = 'white'
tv.editable = False
v.add_subview(tv)

v.present('sheet')
v.wait_modal()
conn.close()

I installed this.

cvp

@shinya.ta said:

I installed this.

Why? I don't understand why you did reinstall this test program

It is sure that Test Hiragana_to_Kanji db and Japanese Braille Input do not have same keyboard, it is normal

shinya.ta

@cvp

Where can I download HiraganaToKanji. db?

cvp

@shinya.ta It is explained above in the topic..file is . here

tapping
Download
options
Run Pythonista3 script
Import file

cvp

I'm back in less than one hour, bye

shinya.ta

@cvp

I downloaded the imported file, but the error appears. Why?

shinya.ta

@cvp

Is there a way to confirm whether it is downloaded properly?

cvp

@shinya.ta First, be sure the dB file is in the same folder as the script
And Pythonista shows a size of 6,4 MB

shinya.ta

@cvp

It was included in the item "FAVORITES".
I don't know the basics.
Please tell me how to solve it.

cvp

@shinya.ta said:

@cvp

It was included in the item "FAVORITES".
I don't know the basics.
Please tell me how to solve it.

You can delete it from favorites, it will not really delete the file

cvp

@shinya.ta to find where is your file, type HiraganaToKanji.db in search field

shinya.ta

@cvp

I searched for it in search field.
After all, it is in my favorite column.
I tried to import it again, but it hasn't changed.

It should be done according to the procedure, but why?

cvp

@shinya.ta what do you call "favorite column"?

cvp

@shinya.ta could you run this little script and after, paste the clipboard here in the forum
The content of your root folder will so be visible here, to check if the Braille keyboard script and the dB file are present

import os
import clipboard
l = os.listdir()
t = ''
for e in l:
    t = t+e+'\n'
clipboard.set(t)
shinya.ta

@cvp

It's in the "FAVORITES" column.

And when you open "Open New.", you'll find it there.

Even if the program is activated, there is no response.

shinya.ta

@cvp

I converted the kanji to the normal one with iPad.

cvp

@shinya.ta said:

And when you open "Open New.", you'll find it there.

I don't understand that

cvp

@shinya.ta said:

I converted the kanji to the normal one with iPad.

I don't understand that

cvp

@shinya.ta If your .db file is in Favorites, you could find where it is by following these steps:
1) tap on its name in the Favorites

2) the file will open in a tab, tap on the little down arrow

3) tap on the folder icon

4) the files browser will open at left, tell what is the first line

shinya.ta

@cvp

I looked for it.
On the first line, it is "This iPhone".
That's why it must have been installed in iPhone, but there is an error.
However, even with the same program, it functioned normally on iPad.

shinya.ta

@cvp

It was successful.
The cause might be the reason why you downloaded it many times.
After I deleted all the unnecessary files, it became normal.

Thank you for your advice.

cvp

@shinya.ta ๐Ÿ‘

In one hour, if you want, I'll explain you how to use it as a custom keyboard in any app using a keyboard for text input...
Or we wait until the program is exactly like your want.

cvp

@shinya.ta Add your custom keyboard

1) Pythonista settings

2) scroll until Pythonista keyboard

3) tap + but you can also first remove unused keyboards...to be tested

4) tap at right of script to choose your script
Eventually choose title, color, icon (you can do later), then add

5) Pythonista beta doc says what you have to do (only once) to enable the Pythonista keyboard:
"You can enable the keyboard in the Settings app (General > Keyboard > Keyboards > Add New Keyboard). It already includes various script shortcuts from the examples folder that you can try right away. If you want to add your own scripts, use the new โ€œShortcuts...โ€ option from the โ€˜wrenchโ€™ menu."

6) then, is the globe key, you can choose Pythonista keyboard(s) as keyboard instead of English, Japanese, Emoji, etc...

Now, in any app, you will receive Pythonista keyboard when you choose Japanese Braille

and you get

shinya.ta

@cvp

I need six more Braille in Japanese.

ใŒใ€ใŽใ€ใใ€ใ’ใ€ใ”
ใ–ใ€ใ˜ใ€ใšใ€ใœใ€ใž
ใ ใ€ใขใ€ใฅใ€ใงใ€ใฉ
ใฐใ€ใณใ€ใถใ€ในใ€ใผ

ใฑใ€ใดใ€ใทใ€ใบใ€ใฝ

The basic six buttons have different symbols and you need to have another word.

http://www.yoihari.com/tenji/tdaku.htm

shinya.ta

@cvp

Thank you for explaining the custom keyboard.
I'll test it right away.

cvp

@shinya.ta said:

I need six more Braille in Japanese.

Sorry, I don't understand.
Do you want 2 x 6 dots instead of 6 dots?
If yes, where to display them?
If yes, how to distinguish characters with 6 dots versus characters with 12 dots?

prefix dot nยฐ4 = dakuten, dot nยฐ6 = handakuten
I understand better but how to say the first 6-dots is finished?
I could for instance accept these both chars with the ok button but needing a second character before to continue...
I'll think about it but if you have a good solution of "how to do", please tell me

cvp

@shinya.ta said:

ใบ

I think I'll solve it but for the end of the week-end
See start point of my work

shinya.ta

@cvp

That way is good. I'd like to accept both of these letters with the OK button and decide the second letter before proceeding.

shinya.ta

@cvp

And I would like to have a cursor move button that I made before.
I want to just move the left and right cursor movements.

cvp

@shinya.ta said:

I want to just move the left and right cursor movements.

Two new buttons between dots 3 and 6?

shinya.ta

@cvp

And you need a Japanese speech.

shinya.ta

@cvp

Yes, I would like to have a button in between.

cvp

@shinya.ta I hope you don't want all of that not too quickly...

cvp

@shinya.ta said:

Yes, I would like to have a button in between.

Cursor buttons like this?

cvp

@shinya.ta said:

And you need a Japanese speech.

Speech automatically or asked via a button?

cvp

@shinya.ta said:

ใบ

I understand that a first character with only dot 5 transforms ใ‹ into ใŒ
and dot 6 transforms ใธ into ใบ

but your list and the list of http://www.yoihari.com/tenji/tdaku.htm
are not the same.
Thus you have to give me the list of accepted characters for each prefix.

shinya.ta

@cvp

http://www.yoihari.com/tenji/tdaku.htm

This list is correct.

I need a Japanese speech for Pythonisa.

You can write the proper words on the Speech over the Japanese speech of PythonIsa and the Voice over the iPhone.

cvp

@shinya.ta said:

This list is correct.

I'm surprised, for instance,
are you're sure that ใŽ is

I suppose that the list of existing dots is ok but the generated image would be different...

cvp

@shinya.ta Please confirm that this list and their graphical representation is correct
the dots are prefix 5 or 6 | normal dots

ใ‹ ใŒ 5|16
ใ ใŽ 5|126
ใ ใ 5|146
ใ‘ ใ’ 5|1246
ใ“ ใ” 5|246
ใ• ใ– 5|156
ใ— ใ˜ 5|1256
ใ™ ใš 5|1456
ใ› ใœ 5|12456
ใ ใž 5|2456
ใŸ ใ  5|135
ใก ใข 5|1235
ใค ใฅ 5|1345
ใฆ ใง 5|12345
ใจ ใฉ 5|2345
ใฏ ใฐ 5|136
ใฒ ใณ 5|1236
ใต ใถ 5|1346
ใธ ใน 5|12346
ใป ใผ 5|2346
ใฏ ใฑ 6|136
ใฒ ใด 6|1236
ใต ใท 6|1346
ใธ ใบ 6|12346
ใป ใฝ 6|2346

for those who would be intellectually interested, I have generated that by a little script,
after having discovered that the only difference between this 6-dots prefix is the last half-byte to which is added 1 or a 2 (ex: x8b -> x8c)

def p(dots,prefix,ch):                                          # ex: 5,ใ‹
    d = 1 if prefix == '5' else 2               # ex: 5 -> 1           6 -> 2
    b = ch.encode('utf-8')                          # ex: b'\xe3\x81\x8b'
    n = b[:-1] + bytes([int(b[-1])+d])  # ex: b'\xe3\x81\x8c'
    c = str(n,'utf-8')                                  # ex: ใ‹ -> ใŒ          ใธ -> ใบ 
    print(ch,c,dots)

for ele in Japanese_Braille.keys():
    if '|' in ele:                                          # ex: 5|1345
        prefix = ele[0]                                     # ex: 5
        k = ele[2:]                                             # ex:   1345
        ch = Japanese_Braille[k]                    # ex: ใค
        p(ele,prefix,ch)
cvp

New Version 0.7

# Version 0.7
# - bug corrected: sqlite3 operationalerror accessing HiraganaToKanji.db
#                  was not intercepted
# - new: cursor left and right move buttons
# - new: support Hirgana with one/dot prefix for (han)dakuten

To input characters with dakuten or handakuten like ใŒ or ใด

  • tap the prefix dot 5 or 6
  • tap โœ… to say that the dots are ended
    the program recognizes this as a prefix and waits for a second dots set
  • tap all dots of normal character like 1236 for ใฒ
  • tap โœ…
    the accentuated hirgana is generated like ใด

This version does not yet support speech, for this, I wait that you explain when and what has to be spoken...ex: the Kanji when it is sent to the TextField

Perhaps, one day ๐Ÿ˜€,you will also ask me to support Yล-on which is supported in Japanese Braille

shinya.ta

@cvp

I took a test.
It's great.

And I'd like to have a text field and a speech on the conversion list.

cvp

@shinya.ta Finish for today, I have a dinner outside.
Tomorrow, mothers' Day, thus not a lot free
Monday should be ok to go with the program, sorry for the delay

Did you check the words with prefix?
Did you test with custom keyboard in another app?

shinya.ta

@cvp

I tested the prefix.

It functioned normally.
The test for other applications is not yet done.
Just a moment, please.

shinya.ta

@cvp

http://www.yoihari.com/tenji/tyou.htm

http://www.yoihari.com/tenji/tsuji.htm

http://www.yoihari.com/tenji/tkigo.htm

This Braille is also necessary.
There are some other details, but I don't remember well, so the necessary Braille is only this.

cvp

@shinya.ta It becomes really complicated, let me some time to try to understand...

cvp

@shinya.ta The Yล-on table that you link is a katakana list, not hirgana

For instance, are you sur that you want ใ‚ญใƒฃ instead of ใใ‚ƒ

It is important to decide before I begin this very complex part...

shinya.ta

@cvp

The list is displayed in Katakana, but there is no distinction between Hiragana and Katakana.
Because, for visually-impaired people, the distinction between Katakana and Hiragana is irrelevant to reading a document.

http://www.yoihari.com/tenji/omotegazo.html

cvp

@shinya.ta Ok, understood, but for the display, what do you want? Because I have to display it to generate a voice

cvp

@shinya.ta Digits process is also very complex, due to this rule

Words immediately follow numbers, unless they begin with a vowel or with r-. 
Because the syllables a i u e o and ra ri ru re ro are homographic with the digits 0โ€“9, 
a hyphen is inserted to separate them.
 Thus 6ไบบ "six people" (6 nin) is written without a hyphen, โ ผโ ‹โ ‡โ ด โŸจ6ninโŸฉ, 
but 6ๅ†† "six yen" (6 en) is written with a hyphen, โ ผโ ‹โ คโ ‹โ ด โŸจ6-enโŸฉ, 
because โ ผโ ‹โ ‹โ ด would be read as โŸจ66nโŸฉ.

Thus I'll need some time to program that...

All of this would normally be done next week as I have a feast today...

I hope that you understand that this kind of program is not written very quickly ๐Ÿ˜€

shinya.ta

@cvp

I think you can put Katakana into the conversion list of Kanji.

I won't rush.
Slowly, please.

cvp

@shinya.ta I have a question for digits.

The hyphen that needs to be inserted in some cases after a digit, is it your wife who has to do it?
If yes, the program does not need to have this special process, but the blind user?
Am I right ?

shinya.ta

@cvp

I use it sometimes.
I'll use the figures.

cvp

@shinya.ta New version 0.8

# Version 0.8
# - new: support Yล-on, displayed as Katakana
# - new: support arab digits with special process:
#                prefix is valable until next char is not a digit 
#          or an hyphen which is not displayed.
#                But the following process has to be done by user:
#         "Words immediately follow numbers, unless they begin with a vowel or 
#          with r-. 
#          Because the syllables a i u e o and ra ri ru re ro are homographic
#          with the digits 0โ€“9, an hyphen is inserted to separate them.
#          Thus 6ไบบ "six people" (6 nin) is written w/o hyphen'' โ ผโ ‹โ ‡โ ด โŸจ6nin)
#          but 6ๅ†† "six yen" (6 en) is written with a hyphen, โ ผโ ‹โ คโ ‹โ ด โŸจ6-enโŸฉ,
#          because โ ผโ ‹โ ‹โ ด would be read as โŸจ66nโŸฉ."
#  - new: support Japanese punctuation of one single dots set: -ใ€‚๏ผŸ๏ผใ€ใƒป

This version does not yet support:
- complex punctuation with start and end characters, like ๏ผˆใƒปใƒปใƒป๏ผ‰, ใ€Œใƒปใƒปใƒปใ€
- I don't understand all in http://www.yoihari.com/tenji/tkigo.htm
- speech

I also have some questions:
- how do you want your wife inserts a space (blank)?
- how does your wife scroll the list of possible conversions?
- and thus how speech the content of the list
- do you want the speech functionality only on
- the selected Kanji inserted in the TextField

shinya.ta

@cvp

If you swipe with three fingers, the conversion list will scroll.
So, the conversion list is more likely to react if you display it a little bigger.

My wife doesn't use much space when making mail.

The voice recognition function requires not only the text field but also the voice guidance of the Chinese character list.

shinya.ta

@cvp

I'm sorry.
It's a mistake in kanji.

Chinese.โ†’kanji

cvp

@shinya.ta two questions:

  • scroll list with 3 fingers swipe, do I need to program that or is that standard with VoiceOver?
    Edit: just discovered that this swipe is a standard VoiceOver feature
  • you want speech the Kanji's list, I don't understand how to do that, because as soon a Kanji is selected, it is going to the TextField. Which element of the list could I speech?

For instance, I could try to say (speech) the first visible item on the list.
Then when you scroll one line, the first will change and would be said.
Of course, I should need to add some blank lines on the list so even the last one the first visible... Hoping I'm clear enough.

If your wife is able to see all buttons like delete, close, ok, conversion,
I could add 3 buttons at right of list,
- down one in the list, program would down one the list and say the element
- up one in the list, program would up one in the list and say the element
- select current, program would select the element and send it to the TextField

Please, discuss it with your wife and give me a feedback

This figure is not yet programmed but only to show how it could be, also bigger font for the list

shinya.ta

@cvp

The button layout like the one in the example is the best.

I hope there will be an explanation when you scroll a line.

My wife knows the position of the button properly.

It is exactly approaching the ideal keyboard.

cvp

@shinya.ta Ok, I'll change to do so.
When I display the list, I'll program to speech the first line.
When you will scroll, I'll program to speech the next (down or up) line.
I'll also try to change the color of the spoken line, useful for testing.

cvp

@shinya.ta New Version 0.9

# Version 0.9
# - new: support some punctuation with 2 characters: โ€”
# - new: speech selected Kanji sent to TextField
# - mod: bigger font and rowheight of Kanji's conversion list
# - new: kanji's tableview scroll and select via buttons
#                - current element is red, if you tap โœ…, it will be sent to Textfield
#                - bug: I can't actually put this current element at first visible
#                               row because content_offset does not work like I think
#                               wait and see

Some remarks:
- speech does not work on my iPad, thus tell me if it is ok for you.
- complex punctuations not yet programmed
- see remark above about current element, problem not solved but you can use buttons to scroll even if you don't see the red element without manually scrolling by swiping
Be patient, I'll solve it, I hope

I'm away from tomorrow for 4 days, thus don't hope quick other improvements

shinya.ta

@cvp

I forgot to tell you, but there was a problem with the previous version.

Cursor move button.
Top and bottom buttons of the conversion list.
Green and Red Decision Buttons.
Delete button.

There is no explanation, so I cannot judge just by the speech.

This is my iPhoneXS Max test, but this device doesn't give you a speech on Pythonisa.
It is only the speech over standard voice Over.
I don't know why.

In my previous text cursor move application, my iPhoneXs Max didn't give me a speech.

Before I use my wife's iPhone seven, I have a test on my iPhone, but I don't know whether or not I'll give a proper speech.

cvp

@shinya.ta If a button has a title, is this title spoken by VoiceOver?

If yes, I can change all icons by a text, even a Japanese text but you have to give me these texts.

shinya.ta

@cvp

If there is a title on the button, there is a proper explanation.
At present, the number of buttons on Braille and the conversion button of Chinese characters are explained properly.

cvp

@shinya.ta Ok, then give to me all texts you want to see on buttons:
Ex:
close: ้–‰ใ˜ใ‚‹
delete: ๅ‰Š้™คใ™ใ‚‹

shortest as possible because button is not big but even with small font, it will be spoken

shinya.ta

@cvp

Thank you. Now you'll be able to do a reliable test.

shinya.ta

@cvp

In version 0.9, you can't input dullness.

cvp

@shinya.ta said:

Now you'll be able to do a reliable test.

Sorry, but I wait on your texts

cvp

@shinya.ta said:

you can't input dullness.

I don't understand "dullness"

shinya.ta

@cvp

ใŒใ€ใŽใ€ใใ€ใ’ใ€ใ”
ใ ใ€ใขใ€ใฅใ€ใงใ€ใฉ
ใฐใ€ใณใ€ใถใ€ในใ€ใผ

You can't input this letter in version 0.9.

cvp

New Version 1.0

# Version 1.0
# - new: use ObjectiveC AVSpeechSynthesizer instead of Pythonista speech
#                because speech does not work on iPad mini 4 and iPhone XS Max

Could you try speech on your iPhone XS Max please.

cvp

New Version 1.1

# Version 1.1
# - bug: dot 5 prefix does not work since dot-5 point
#                temporary remove dot 5 point
cvp

@shinya.ta Please give me feedback about two last versions, thanks

cvp

@shinya.ta said:

You can't input this letter in version 0.9.

See Version 1.1

shinya.ta

@cvp

After the kanji characters are changed, they start to read different English and read the words in the text field.
Reading aloud is just reading aloud with normal voice over.

shinya.ta

@cvp

Reading aloud is only voice Over.

shinya.ta

@cvp

I didn't have a hiragana file in my wife yet.
Where was the link destination of the hiragana file?

cvp

@shinya.ta said:

Where was the link destination of the hiragana file?

download this file by
- tapping Download
- options
- Run Pythonista3 script
- Import file

cvp

@shinya.ta Could you try this little script and tell me if it speaks in Japanese on your iPhone XS Max

from objc_util import *
AVSpeechUtterance=ObjCClass('AVSpeechUtterance')
AVSpeechSynthesizer=ObjCClass('AVSpeechSynthesizer')
AVSpeechSynthesisVoice=ObjCClass('AVSpeechSynthesisVoice')
voices=AVSpeechSynthesisVoice.speechVoices()
for i in range(0,len(voices)):
    if 'ja-JP' in str(voices[i].description()):
        voice_jp = i
        break
#   print(i,voices[i],voices[i].description())
voice = voices[voice_jp] # Japon = 31,32,33
synthesizer=AVSpeechSynthesizer.new()
utterance=AVSpeechUtterance.speechUtteranceWithString_("ใ“ใ‚“ใซใกใฏใ€ๅ‹ใ‚ˆ")
utterance.rate=0.5
utterance.voice=voice
utterance.useCompactVoice=False 
synthesizer.speakUtterance_(utterance)from objc_util import *
AVSpeechUtterance=ObjCClass('AVSpeechUtterance')
AVSpeechSynthesizer=ObjCClass('AVSpeechSynthesizer')
AVSpeechSynthesisVoice=ObjCClass('AVSpeechSynthesisVoice')
voices=AVSpeechSynthesisVoice.speechVoices()
for i in range(0,len(voices)):
    if 'ja-JP' in str(voices[i].description()):
        voice_jp = i
        break
#   print(i,voices[i],voices[i].description())
voice = voices[voice_jp] # Japon = 31,32,33
synthesizer=AVSpeechSynthesizer.new()
utterance=AVSpeechUtterance.speechUtteranceWithString_("ใ“ใ‚“ใซใกใฏใ€ๅ‹ใ‚ˆ")
utterance.rate=0.5
utterance.voice=voice
utterance.useCompactVoice=False 
synthesizer.speakUtterance_(utterance)
shinya.ta

@cvp

synthesizer.speakUtterance_(utterance)from objc_util import *

There is an error here.
"Syntax Error invalid syntax" appears.

shinya.ta

@cvp

When I tried to download a file to my wife's iPhone, it turned out to be a screen like this and I couldn't do it.

Is something missing?

cvp

@shinya.ta said:

synthesizer.speakUtterance_(utterance)from objc_util import *

I think you have had a bad paste of my script, because it was

from objc_util import *
AVSpeechUtterance=ObjCClass('AVSpeechUtterance')
X
X
X
X
synthesizer.speakUtterance_(utterance)

You made two times the paste...be careful please

cvp

@shinya.ta said:

When I tried to download a file to my wife's iPhone, it turned out to be a screen like this and I couldn't do it.

Sorry, I don't understand this sentence

shinya.ta

@cvp

Should I turn off the import?

It's a mystery, but my wife's iPhone seven can't download a Japanese file.
Is something missing?

cvp

@shinya.ta which step does not work?
- tapping Download
- options
- Run Pythonista3 script
- Import file

shinya.ta

@cvp

tapping Download
Run Pythonista3 script

The color of the file shown is different.
It is similar to the symptom that my iPhone could not execute.
But, in my case, it was because I downloaded the same file many times.
My wife is the first time to download it.

cvp

@shinya.ta said:

The color of the file shown is different

I don't understand that. After "run Pythonista", did you tap on " import file"?

cvp

@shinya.ta And did you retry to paste my little scrip about speech with objectivec

shinya.ta

@cvp

The execution icon of Pythonisa doesn't come out.

shinya.ta

@cvp

I don't know where to change it.
Where do I delete it?

shinya.ta

@cvp

The problem of my wife's iPhone seven has been solved.
After restarting, it was solved.

The iPhone gave me a speech, but I don't have the explanation of Kanji, so I don't know which Kanji I chose.

In the former cursor moving application, I had good connection with Voice Over.

cvp

@shinya.ta I'll continue to search this problem of VoiceOver on TableView content but I don't have a lot of free time this week, because I'm in holiday (4 days) in France...

Did you on your iPhone XS Max test my little script about objectivec speech?

shinya.ta

@cvp

I took a test but nothing happened.

shinya.ta

@cvp

from objc_util import *
AVSpeechUtterance=ObjCClass('AVSpeechUtterance')
AVSpeechSynthesizer=ObjCClass('AVSpeechSynthesizer')
AVSpeechSynthesisVoice=ObjCClass('AVSpeechSynthesisVoice')
voices=AVSpeechSynthesisVoice.speechVoices()
for i in range(0,len(voices)):
    if 'ja-JP' in str(voices[i].description()):
        voice_jp = i
        break
#   print(i,voices[i],voices[i].description())
voice = voices[voice_jp] # Japon = 31,32,33
synthesizer=AVSpeechSynthesizer.new()
utterance=AVSpeechUtterance.speechUtteranceWithString_("ใ“ใ‚“ใซใกใฏใ€ๅ‹ใ‚ˆ")
utterance.rate=0.5
utterance.voice=voice
utterance.useCompactVoice=False 
synthesizer.speakUtterance_(utterance)

Is this all right?

cvp

@shinya.ta Yes, now the script is right but I hoped you will hear the speech like I did on my iPad mini4.
Really, I don't understand what is the problem on your iPhone

Are you sure the volume is set in your control center?

shinya.ta

@cvp

The program itself doesn't work, not because of the volume problem.

cvp

@shinya.ta could you try on another device than your iPhone XS Max. I remember that you always got speech problem with it.
Test only to be sure the program is ok for you

Because it runs ok on my iPad mini 4 and Pythonista speech does not work

cvp

@shinya.ta Could we try to summarize remaining problems?
- complex punctuations in Braille
- VoiceOver on conversion TableView elements
- speech on your iPhone
- you decide the buttons titles, so VoiceOver speaks them

Is something missing?

shinya.ta

@cvp

The speech on my iPhone is not much of a problem.
I wanted to know the difference between my wife's iPhone and my iPhone.
You need a punctuation mark.

cvp

@shinya.ta said:

You need a punctuation mark.

I don't understand

shinya.ta

@cvp

The narration of conversion elements is always necessary.

cvp

@shinya.ta said:

The narration of conversion elements is always necessary.

That, I understand but not yet solved...
Does the iPhone of your wife not speak each row when scroll via buttons?

shinya.ta

@cvp

Complicated punctuation marks in braille are required.
You need to decide the title of the button and read it.

cvp

@shinya.ta said:

Complicated punctuation marks in braille are required.

This is in my todo list but will need some time

cvp

@shinya.ta said:

You need to decide the title of the button and read it.

The title of buttons need to be in Japanese, thus YOU have to decide them

shinya.ta

@cvp

The Kanji of each line is the same way of reading.
So, you need to explain each one kanji.

cvp

@shinya.ta said:

So, you need to explain each one kanji.

How can I do that?

shinya.ta

@cvp

For voice Over, the explanation of Kanji is read out.
For example, the Kanji of "้ซ˜" is pronounced as high and low.

cvp

@shinya.ta said:

For voice Over, the explanation of Kanji is read out.

Ok but what do you want I do?

shinya.ta

@cvp

If you start the Braille keyboard, the existing conversion list won't appear.
So, is it possible to make a list of existing conversion lists at Pythonisa?

cvp

@shinya.ta Sorry, but again, I do not understand. It is sad that you did not want to try to take a copy of the screen and post it in this forum

shinya.ta

@cvp

I can't make it difficult to put pictures on this forum.
I think you won't be able to understand if it is not a video.

https://m.youtube.com/watch?feature=youtu.be&v=Ro8b8_DMurs

cvp

@shinya.ta I understand the VoiceOver part but I don't understand what you want my script has to do, I'm very sorry.
Do you want another aspect of the TableView list of possible conversions?

shinya.ta

@cvp

If you have a detailed explanation of kanji, everything will be solved.

cvp

@shinya.ta New Version 1.2

Could you try, please, this version with VoiceOver, by tapping once a up,ok, down button in the conversion list.
I change the title of the button when scrolling, so when you tap on a button, VoiceOver should speech and pronounce the Kanji you would get if you tap up, or down, or select.
Please, give me a feedback, it is almost impossible for me to test because I write now all in Japanese.

This version has also a title on each button, instead of an icon, to allow VoiceOver to pronounce a clear text for your wife.
Each button has also a background image so non blinded people can test, because the title on the button is too long to be readable but its image is self-explanatory.

shinya.ta

@cvp

I want an explanation of kanji.

Example.

ใ‚ใ‚โ†’้›จโ†’Rain.
ใ‚ใ‚โ†’้ฃดโ†’Candy.

All the meanings are different, but the pronunciation is the same.

cvp

@shinya.ta As usual, I don't understand.
When VoiceOver says ้›จ, is that not understandable by a Japanese?
Or do you want it says rain in English?

shinya.ta

@cvp

The pronunciation is the same, so I cannot understand just by listening to the words.
For example, when it comes to rain, you need an explanation about rain that falls down from the sky.

cvp

@shinya.ta ok, understood
But where can I find this explanation?

shinya.ta

@cvp

The function of voice Over is standard, so if you can access the function, I think it will be possible.
But I don't know if you can do it with Pythonisa.

cvp

@shinya.ta said:

ใ‚ใ‚โ†’้›จโ†’Rain

I don't understand yet how VoiceOver works.
If you have a button with ้›จ as title, if you are not blind, do you understand the word as rain?
If you are blind, what says VoiceOver if you tap this button?

shinya.ta

@cvp

If you see it, you can see the meaning by only displaying the Chinese characters.
If I close my eyes and operate it, I can't judge the sound alone.

cvp

@shinya.ta Could you write here, in Japanese, what VoiceOver says if you tap on ้›จ in a text.

shinya.ta

@cvp

In voice over, it is called rain on rainy days.

cvp

@shinya.ta In Japanese?

cvp

@shinya.ta Believe me, I spend some time to search how I could program that.
If I set as title of "scroll down button" of the conversion list, the string ้›จ, you say that VoiceOver only says the sound of the text, not something explaining the Kanji.
Thus, I search where I could find the explanation, in Japanese, of the Kanji.

shinya.ta

@cvp

The rain is explained in Japanese.

cvp

@shinya.ta in this little script, what says VoiceOver if you tap on the button

import ui
v = ui.View()
b = ui.Button()
b.frame = (10,10,32,32)
b.title = '้›จ'
b.border_width = 1
v.add_subview(b)
v.present('sheet')
shinya.ta

@cvp

I only pronounce it as rain.

cvp

@shinya.ta I don't understand why VoiceOver pronounces ร  button title as one word and if you tap a text it says a kind of definition

Then, I try to find a file kanji -> definition in Japanese

shinya.ta

@cvp

The explanation of the button title of the button and Chinese characters will continue to be announced.
You pronounce the kanji characters which are finished in the text field as they are.
Because, when the input is finished, the content of the document is understood.

cvp

@shinya.ta A new version arrives where VoiceOver should say a sentence as examples of Kanji for up/down/ok buttons.

First you have to download SentencesEngJpn.dat file

  • tapping Download
  • options
  • Run Pythonista3 script
  • Import file
cvp

@shinya.ta New Version 1.3

# Version 1.3
# - new: buttons up,ok, down in conversion list will have as variable title
#                a sentence as example of the kanji which would be generated if
#                pressed 
#                needs SentencesEngJpn.dat file in same folder as script
shinya.ta

@cvp

Go. ่กŒใ‘ใ€‚
Go. ่กŒใใชใ•ใ„ใ€‚
Hi. ใ‚„ใฃใปใƒผใ€‚
Hi. ใ“ใ‚“ใซใกใฏ๏ผ
Run. ่ตฐใ‚Œใ€‚
Run. ่ตฐใฃใฆ๏ผ
Who? ่ชฐ๏ผŸ
Wow! ใ™ใ”ใ„๏ผ
Wow! ใƒฏใ‚ฉ๏ผ
Wow! ใ‚ใ‰๏ผ
Fire! ็ซไบ‹ใ ๏ผ
Fire! ็ซไบ‹๏ผ
Help! ๅŠฉใ‘ใฆ๏ผ...

When I tried to download it, this kind of list came out.

cvp

@shinya.ta I think you tried to download in raw, you did not follow the steps I describe...

  • tapping Download
  • options
  • Run Pythonista3 script
  • Import file
shinya.ta

@cvp

When I tapped the download button, it became this list already.

cvp

@shinya.ta sorry, you are right, it is because it is a text file but too big, I find another way, wait please

cvp

@shinya.ta Do you use my DownloadGithubRawFile.py script to download big scripts?
If yes, you can download the SentencesEngJpn.dat file in the same way

shinya.ta

@cvp

I'm not sure, but I think it's different.

cvp

@shinya.ta Please, tell me if it has been ok for downloading the file

cvp

@shinya.ta It is almost the same, you go on the file in Github, you copy the url, you paste this url in my download script, wait the until file is loaded, then you tap the cloud button above right and it is done.

cvp

@shinya.ta

cvp

@shinya.ta if still problems:
- go to https://github.com/cvpe/Pythonista-scripts/blob/master/SentencesEngJpn.dat
- tap download
- when you get the list, tap the share button of Safari
- tap the copy button
- in Pythonista, run my DownloadGithubRawFile.py
- in the url field, erase the google link
- paste
- enter
- wait the file is loaded, then tap the cloud button

It is done

shinya.ta

@cvp

in Pythonista, run my DownloadGithubRawFile.py

It says "Don't have a server".

shinya.ta

@cvp

Can't I download it on iPhone?
I will try it on iPad after finishing my work.

shinya.ta

@cvp

It says No Folder.

cvp

@shinya.ta Usually, how do you download my keyboard script?

cvp

@shinya.ta said:

It says No Folder.

My download program says "No Folder_Picker, file copied on root",
but the SentencesEngJpn.dat file has been downloaded in the root of Pythonista.
If you keyboard script is also there, the new version should work, try it.

This message appears if you don't have the Folder_Picker.py module which allows you to select the destination folder of the downloaded file. It is an optional import module.

If you are intererested by this module, you can get it here
Once it has been downloaded in the root, you will have to move it to your site-packages folder.
And the next times you will use DownloadGithubRawFile.py, it will ask you where to download the file...Good luck

shinya.ta

@cvp

Usually, the program is copied and pasted.

cvp

@shinya.ta As you have used my download script for the sentences file, did you check if this file is now present in the root?

shinya.ta

@cvp

How can I confirm it?

cvp

@shinya.ta Check if this file is there

shinya.ta

@cvp

Yes, I do.

cvp

@shinya.ta Thus, now, you can test the last version of my keyboard script to test if VoiceOver says a sentence using the Kanji when you tap up/ok/down buttons in the conversion list

shinya.ta

@cvp

I was tested.

It's a wonderful finish.

The explanation was properly done.
But there is one problem.
Difficulty distinguishing the location of the present list and the description of the next list.
It's easier to understand if you explain when you are touching the decision button.
That way, you can understand the location of the present list.

cvp

@shinya.ta Good news๐Ÿ˜… We go on step by step, slowly but we'll survive.

Now, when the conversion list is displayed, you have 3 buttons.
When you tap a scroll up or down button, VoiceOver says the Kanji that you will get if you tap ok after.
And if you tap ok once, it says the same Kanji, just to be sure before you tap twice to accept this Kanji and send it to the TextField.

I don't understand what you want.
I could say nothing when you tap on a scroll but in this case, you should need to tap the ok button once to hear what is the selected Kanji. That way needs a step more.
Think about that and try to explain clearly what you want for each of the 3 buttons.

shinya.ta

@cvp

I think it takes time to get used to it, so I will try to use it several times.
If it doesn't work, please change it.

cvp

@shinya.ta

Try New Version 1.4 and tell me which one you prefer

# Version 1.4
# - mod: remove variable title of up and down scroll buttons in list
#       to avoid confusion with ok button when using VoiceOver
#        ***** needs to be confirmed by user tests *****
# - new: support some punctuations by pair: () ใ€Œใ€
#       with only one dots-character as delimiter
shinya.ta

@cvp

Version 1.4 is easier to use.
I think this is perfect.

Can I add a list of Chinese characters by myself?

cvp

@shinya.ta I would prefer to maintain my-self the script because it would be easier for both if you find bugs or ask modifications and we would have different programs

But, anyway, you are free if YOU prefer.
I could modify the script so the Kanji's are in a file, outside the program.
Please, give me an example of Chinese character you want to add

But, I think that the program is not fully finished, here-after are some questions I would like you answer, please.

  • Q1: since some versions, I've commented some lines to avoid confusion
    between sentences spoken by the script or by VoiceOver.
    Could you describe in which cases the script has to speech text?
  • Q2: the Braille dots set with only dot 5 can be used as
    - a prefix for Dakuon
    - an interwords dot
    do you agree if the program, when it meets a dot-5 character,
    will consider it as a prefix unless if next character is not
    a dakuon dots set?
  • Q3: when you tap on up/down/ok button of the conversion list, VoiceOver
    says a sentence as an example of the Kanji. Perhaps is the sentence not
    sufficient to explain the Kanji.
    Do you want a supplementar button that generates another sentence?
    So, next tap on ok will say another example.
  • Q4: buttons have an icon and a title used by VoiceOver.
    Do you want that I use a transparent color for the title, so you would
    only see the icon but VoiceOver will still say the title?
  • Q5: do you want a way to insert a space, and if yes, how?
    By example, a "large" button between the left and right
shinya.ta

@cvp

Q1.If you convert kanji characters, you can speak English and kanji characters.

Q2.I'm sorry, but I don't understand the meaning.
Q3.I'm sorry, but I don't understand the meaning of the supplementary button.

Q4.Even with the present transparent button, the content of the button will be read out.

Q5.I don't use much space in Japanese, so I don't need it.

cvp

@shinya.ta Let me some time to answer....

But first, Please, give me an example of Chinese character you want to add, to be sure I correctly understand your request

cvp

@shinya.ta
Q2: http://www.yoihari.com/tenji/tkigo.htm shows that
Braille dot 5 alone is a interwords point.
But, dot 5 is also used as prefix for another character => dakuten
ex: dot 5 = .
ex: dot 5 followed by dots 1-6 = ใŒ
when the user taps dot-5, the script has no way to know what will follow...
I propose that if the character after dot-5 is not a possible dakuten,
I transform the dot-5 into a point
so dot 5 followed by dots 1456 = ใš
dot 5 followed by dots 145 = .ใ‚‹
Please confirm that you agree...

Q4: see next version

Q5: No process for a space/blank

shinya.ta

@cvp

Q2. It's all right as you think.

I can't think of the Chinese character I want to add right away.
Because the two kanji characters may stick to each other and become a different word.

Example.

ๆœฌใ‚’่ชญใ‚€โ†’่ชญๆ›ธ Reading books.

It's a way to read. ใฉใใ—ใ‚‡
It has the same meaning.

cvp

@shinya.ta New Version 1.5

# Version 1.5
# - new: set color of title of buttons which have a background image
#                as transparent, so title is invisible while it will
#                still be read by VoiceOver
#                nb: conversion button does not have a background image,
#                --- so its title will stay visible
# - mod: user confirmed that he/she does not need support of space/blank
# - new: suppport user additional "Hirgana -> Kanji" via a
#                HiraganaToKanji.txt file containing one line by additional item
#                a tab is needed between hirgana and kanji

If you want to try to add new Hirgana->Kanji, รฉdit a HiraganaToKanji.txt file
and write line by line: hirgana tab kanji, like

ใฉใใ—ใ‚‡    ๆœฌใ‚’่ชญใ‚€
ใฉใใ—ใ‚‡    ่ชญๆ›ธ

Tab =

Please tell me if that is what you hoped...

cvp

@shinya.ta said:

f you convert kanji characters, you can speak English and kanji characters

I don't understand: you want that the program speaks English?

cvp

@shinya.ta You have certainly remarked that beta version of Pythonista3 has expired.
To go on, you should have to reinstall the AppStore (old) version.
You can use my script with the old version but, of course, not as a keyboard in other apps because only the beta version provided this feature. We (almost) all hope that an official new version will arrive soon.

cvp

@shinya.ta

Reinstall beta version, see https://testflight.apple.com/join/qDkBu2ur

shinya.ta

@cvp

Excuse me.
My father is hospitalized now, so I will be late for the answer.

cvp

@shinya.ta No problem, not very important for me

I hope that your father's condition is not too serious

shinya.ta

@cvp

In the text field, we speak both Japanese and English at the same time.
I cannot listen properly.

shinya.ta

@cvp

Version 1.5 is the function I wanted.
Thank you very much.

cvp

@shinya.ta said:

In the text field, we speak both Japanese and English at the same time.

I don't understand.
VoiceOver speaks in Japanese?
But "who" speaks in English? Not my script because I removed speech process, at least temporarily.

shinya.ta

@cvp

Excuse me.
After restarting, I recovered.

cvp

@shinya.ta do not worry, I'm not in a hurry and I have time

cvp

@shinya.ta said:

Version 1.5 is the function I wanted.

Is that relative to the new functionality?

# - new: suppport user additional "Hirgana -> Kanji" via a
#                HiraganaToKanji.txt file containing one line by additional item
#                a tab is needed between hirgana and kanji
shinya.ta

@cvp

It's the best.
It matches perfectly.
As I thought, you are a god.

cvp

@shinya.ta You are very kind, but believe me, I'm far of a god...
Still to do:
- some punctuations
- please, tell me if the program has to speech in some cases, and try to explain them
- I want to make a test version for previous Q3...

cvp

@shinya.ta New Version 1.6

# Version 1.6
# - new: additional button to replace title of conversion selection button
#                by another sentence to be spoken by VoiceOver at next tap.
#                Sentences come from SentencesEngJpn.dat file which could contain
#                several different sentences per Kanji.
#                ================ functionality to be approved by user

When you tap once the select button in the conversion list, VoiceOver says
a sentence containing the selected kanji.
Assume that the spoken sentence does not explain enough the Kanji, the SentencesEngJpn.dat file contains several sentences containing the same Kanji.
It is possible that another sentence could better explain the selected Kanji.
In this version 1.6, there is a new button at left of the list.
If you tap it, the sentence of the title of the ok button is changed, so it you tap afterwards on the ok button, you will hear another sentence.
And so on, you can hear a lot of sentences containing the Kanji.

Please, try and tell me if I keep or remove this functionality.

If you want to keep it, tell me if you want to change
- the icon
- the title "ไป–ใฎๆ–‡" of this button (spoken by VoiceOver)
- the position

shinya.ta

@cvp

This button is very convenient.
The button position is OK here.
Button Title.

Other explanation.

cvp

@shinya.ta Button title in English? If Japanese, please post here the text, thanks
Ex: ใใฎไป–ใฎ่ชฌๆ˜Ž

shinya.ta

@cvp

Please use "Other Explanation" in Japanese.

cvp

@shinya.ta New Version 1.7

# Version 1.7
# - mod: title of kanjis_other button: "other explanation" in Japonese
# - new: dot-5 may be used as a prefix for dakuten 
#                or alone as interwords point 'ใƒป'
#                if character after dot-5 is not a character waited after the prefix,
#                       it will be processed as a dot-5 point
# - bug: dot-5 ok, dot-1 ok displays char 1 but this char is not generated
# - del: remove support of setting dots position by touching the screen with
#          six fingers during more than 6 seconds.
#                    this process is not compatible with existence of other buttons
#                remove usage of keychain for saving these positions
cvp

@shinya.ta Hello, hoping you are good.
Please give me some feedback about last version and do never hesitate to ask me corrections or new functionalities

shinya.ta

@cvp

I'm glad to hear the explanation button and I'm very glad.
After that, I'll try to input various words and test if there is no shortage.

cvp

@shinya.ta ok, thus
- I wait for description of bugs/problems you would meet
- Please, tell me which missing punctuations are really needed
- I still wait for an explanation of what you want the program speaks it-self, outside of what Voiceover says

shinya.ta

@cvp

I'm really sorry.
My father doesn't feel well and I haven't tested yet.
Please wait a little longer.

cvp

@shinya.ta No problem for me... There are very more important things than a little program.

shinya.ta

@cvp

I'm sorry for the delay.

I took a test.
So far, everything is perfect.
The punctuation you often use is fine now.

And what I want to pray is just to wait for the beta version to be the regular version.

cvp

@shinya.ta
No problem for the delay, be cool.

I'm optimistic about the future version.

Do not forget my "I still wait for an explanation of what you want the program speaks it-self, outside of what Voiceover says"

shinya.ta

@cvp

I thought it would be easier to understand if you explain the other words in English depending on the words.

Exampleโ€ฆ

ๆ„›๏ผˆใ‚ใ„๏ผ‰โ†’Loveใฎๆ„›
ๆฉ‹๏ผˆใฏใ—๏ผ‰โ†’ Bridgeใฎๆฉ‹
็ฎธ๏ผˆใฏใ—๏ผ‰โ†’Chopsticksใฎ็ฎธ

cvp

@shinya.ta said:

I thought it would be easier to understand if you explain the other words in English depending on the words.

Hello
What do you call "other words"?
Do you want that VoiceOver tells you the English translation of a word that you select with the ok button in Kanji's list?

And what is "depending on the words"?

ellie_ff1493

i have seen this pop up lots and it looks quite nice, can i contribute to it?

cvp

@ellie_ff1493 Why not but don't forget that @shinya.ta 's wife is the user, thus the "project manager"

shinya.ta

@cvp

I'm sorry.
I didn't have enough explanation.

It means other conversion buttons.

cvp

@shinya.ta Could you try the New Version 1.8

# Version 1.8
# - mod: some Python improvements adviced by @ccc
#   - mod: 'other explanation' button will generate next sentence in English
#                instead of Japanese
shinya.ta

@cvp

I'm late.
I tried to give you a test but there is no explanation even if I press the other explanation button.

cvp

@shinya.ta Normally, like in previous version, you have to tap "other" then "select" one time.
The other action is to set the title of the select button.
Then, other has to be tapped first one time, second two times to force action.
The select button tapped once will force VoiceOver to read the title now in English.
It so that I did understand your request

If I did not understand correctly, please tell me
What you want that Voiceover says when you tap
- one time on other button, VoiceOver only reads the title
Tap two times will execute some code, actually change the title of the select button.
I know it is not easy but it is what you asked in Japanese on previous versions.

shinya.ta

@cvp

It's done.
If possible, I'd like to explain the explanation when I press the other explanation button.
You press the wrong decision button by mistake.

cvp

@shinya.ta I propose to process like this:
- The title of the "other" button will be set as the first other explanation
- if you tap one time this button, VoiceOver would read this explanation
- if after that, you press it twice, another title will be set with a next explanation.

Thus, the title of the select button will also be set as the previous explanation, not the same as the title of the other button...

Please, confirm I correctly understand.
If you say yes, I'll send a new version less than one hour after.
Of course, if your tests show it is not the right way, it is not very important, we would change one more time ๐Ÿ˜€

shinya.ta

@cvp

Yes.
I understand the meaning at last.

cvp

@shinya.ta I can't test my-self, hoping it is ok, Version 1.9

# Version 1.9
# - mod: title of "kanjis_other" button = next other explanation
#        title of "kanjis_ok" button = actual explanation
#                 set to next when "kanjis_other" pressed
shinya.ta

@cvp

It's perfect.
You helped me.
After all, you were my god.
Thank you, thank you.

cvp

@shinya.ta Really, if I'm your god, please change your religion ๐Ÿ˜‚

Websightpro

Braille Tutor provides an interactive learning experience for a sighted or blind braille learner. It works on iPad using onscreen keys or home keys on a Bluetooth keyboard. It is self-voiced, but also works with iOS accessibility. The app uses sounds and text-to-speech to support vision-impaired learners. Websightpro

create0

Thank you so much truly a cognitive concept. I do appreciate the effort and hope to get more information.