if i have this text
[tex]
INPUT STRING: شمس
LOOK-UP WORD: $ms
SOLUTION 1: ($amasa) [$amas-u_1] $amas/VERB_PERFECT+a/PVSUFF_SUBJ:3MS
(GLOSS): + be headstrong + he/it
SOLUTION 2: ($amisa) [$amis-a_1] $amis/VERB_PERFECT+a/PVSUFF_SUBJ:3MS
(GLOSS): + be sunny + he/it
SOLUTION 3: ($am~asa) [$am~as_1] $am~as/VERB_PERFECT+a/PVSUFF_SUBJ:3MS
(GLOSS): + expose to the sun + he/it
SOLUTION 4: ($amos) [$amos_1] $amos/NOUN
(GLOSS): + sun +
SOLUTION 5: ($amos) [$amos_2] $amos/NOUN_PROP
(GLOSS): + Shams +
INPUT STRING: البحرين
LOOK-UP WORD: AlbHryn
SOLUTION 1: (AlbaHorayoni) [baHorayoni_1] Al/DET+baHorayoni/NOUN_PROP
(GLOSS): the + Bahrain +
SOLUTION 2: (AlbaHorayoni) [baHor_1] Al/DET+baHor/NOUN+ayoni/NSUFF_MASC_DU_ACCGEN
(GLOSS): the + sea + two
[/tex]
and i want to take the solutions and put them in a popup menu
for example for the first INPUT STRING: شمس
the options should be
1.$amasa
2.$amisa
3.$am~asa
4.$amos
5.$amos
when user right click on that word the five options should appear
i tried to search the text to find the first option but how can i put it in the popup menu and how can i find other solutions
this is the code i used
Private Sub FindText(ByVal start_at As Integer)
Dim pos As Integer
Dim target As String
target = "SOLUTION"
pos = InStr(start_at, txtBody.Text, target)
If pos > 0 Then
'We found it.
TargetPosition = pos
txtBody.SelStart = TargetPosition + 12
txtBody.SelLength = Len(target) - 2
txtBody.SetFocus
Else
'We did not find it.
MsgBox "Not found."
txtBody.SetFocus
End If
End Sub
how can i stop seleting until i reach ')'
anybody help
Is it all in the same line, like the picture that you have posted? If not, how does it look exactly, can you paste some of the file in code tags. I can help you much more with that then.
i think that i should explain what i want to do
first i should run a perl script from vb
i should pass an arabic encoding .txt file to perl to get another .txt file, pearl scirpt should analyze all arabic words and proceed all possible options that could match with all word in the output file
so my job is to let user rigth click on the word and get the options then he should select the wright option that he mean
this is an example of the output that i want to process
INPUT STRING: (
Comment: Non-Alphabetic Data
INPUT STRING: دهب
LOOK-UP WORD: dhb
Comment: dhb NOT FOUND
INPUT STRING: )
Comment: Non-Alphabetic Data
INPUT STRING: Yes
Comment: Non-Alphabetic Data
INPUT STRING: كم
LOOK-UP WORD: km
SOLUTION 1: (kam) [kam_1] kam/REL_PRON
(GLOSS): + how many/much +
SOLUTION 2: (kam) [kam_2] kam/INTERROG_PART
(GLOSS): + how many/much +
SOLUTION 3: (km) [kam_2] km/ABBREV
(GLOSS): + kilometer(s) +
SOLUTION 4: (kam~a) [kam~-u_1] kam~/VERB_PERFECT+a/PVSUFF_SUBJ:3MS
(GLOSS): + cover/hide + he/it
SOLUTION 5: (kam~) [kam~_1] kam~/NOUN
(GLOSS): + amount/quantity +
in ths case i have only 5 inpt strings they r
دهب (this is an arabic word with no meaning) ____ not found
) (not arabic text) ______Non-Alphabetic Data
Yes (not arabic )____Non-Alphabetic Data
( (not arabic )_____Non-Alphabetic Data
كم (an arabic word with five solutions)
so if user rigth clicked the word دهب then popup menu will appear with (not found)
and for the brackets the popup will be (Non-Alphabetic Data)
but in case of the word كم five options will appear
the problem i face is how to saparate each word options and link them to the word it self in the original textbox
this is the code that i wrote to find all of the options and put them in a list
this code can be applyed for an arabic text with solutions only
Option Explicit
Private Target2Position As Integer
Private TargetPosition As Integer
' Find the text.
Private Sub cmdFind_Click()
FindText 1
End Sub
Private Sub FindText(ByVal start_at As Integer)
Dim pos As Integer
Dim pos2 As Integer
Dim target As String
Dim target2 As String
target = "SOLUTION"
target2 = ")"
pos = InStr(start_at, txtBody.Text, target)
If pos > 0 Then
'We found it.
start_at = pos + 12
pos2 = InStr(start_at, txtBody.Text, target2)
Target2Position = pos2
TargetPosition = pos
txtBody.SelStart = TargetPosition + 12
txtBody.SelLength = Target2Position - TargetPosition - 13
txtBody.SetFocus
Else
'We did not find it.
MsgBox "Not found."
txtBody.SetFocus
End If
Text1.Text = txtBody.SelText
List1.AddItem (Text1.Text)
cmdFind.Enabled = False
End Sub
' Find the next occurrance of the text.
Private Sub cmdFindNext_Click()
FindText Target2Position + 1
End Sub