Word VBA >> Differentiating in the Dictionary

by fdde » Fri, 30 Jul 2004 18:51:58 GMT

Hi all,

I have a brilliant question. Is it possible to distuinguish between proper
nouns and regular words using the Word Dictionary in VBA?

I mean, I am looking for a function that will give me a result like this:
IsItName("John")=True
IsItName("Anything")=False
IsItName("Kerry")=True

Thank you for your time.

Vince




Word VBA >> Differentiating in the Dictionary

by Word Heretic » Sat, 31 Jul 2004 07:43:05 GMT


G'day "fdde" < XXXX@XXXXX.COM >,

I friggin wish ;-) You can find [A-Z][a-z]@ to get all Title Case
words, then discard those:

* preceded by either a period & spaces or start of para
* sitting in a non body-text style

This will come close. Unfortunately grammar tools are provided by a
3rd party so I cannot see any such joy in the near future. Man, would
it make NLP easier.

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


fdde reckoned:





Word VBA >> Differentiating in the Dictionary

by fdde » Sat, 31 Jul 2004 09:01:51 GMT

I knew I was asking for too much! Well, your idea would work for sentences
like 'John Kerry gave a sizzling speech at the convention'. However, the
sentences that I have to break down are more like 'John Kerry Gave A
Sizzling Speech At The Convention'. So basically, I would need to find the
names and insert a marker just after the name, something like 'John Kerry ^
Gave A Sizzling Speech At The Convention'. Of course, the noun could appear
in any order, anywhere in the sentence! So, I guess, I'ld have to think of
some other magical solution or better yet, scrap the idea!

Thanks for your reply.




proper




Differentiating in the Dictionary

by Word Heretic » Sun, 01 Aug 2004 12:56:58 GMT

G'day "fdde" < XXXX@XXXXX.COM >,

<Quietly advises scrapping the idea as supporting tech is not in place
yet>

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


fdde reckoned:






Similar Threads

1. Dictionary inside Array inside Dictionary

I wanted to use multiple arrays inside multiple dictionaries.
I get it right to add it in, but I'm having trouble getting it out.
I send the value of tmpArr to a function (getSubs) which returns a
second array. This second array is then added to the first as a
dictionary, etc.

The end result looks like this:
1 = tmpArr = ("a","b","c")
2 = tmpArr = (("d","e","f"), ("d","e","f"),
("d","e","f"))
3 = tmpArr = ((("d","e","f"), ("d","e","f"),
("d","e","f")), (("d","e","f"),
("d","e","f"), ("d","e","f")) ,
(("d","e","f"), ("d","e","f"),
("d","e","f")))

tmpArr = ("a","b","c")

   Set tmpSubs = CreateObject("Scripting.Dictionary")
   for j = 0 to ubound(tmpArr)-1
    tmpArr2 = getSubs(tmpArr(j))

'2--------------
     Set tmpSubs2 = CreateObject("Scripting.Dictionary")
     for m = 0 to ubound(tmpArr2)-1
      tmpArr3 = getSubs(tmpArr2(m))
      tmpSubs2.Add tmpArr2(m), tmpArr3
      tmpArr2(m) = tmpSubs2.Item(tmpArr2(m))
     next
     tmpSubs2.RemoveAll
     tmpSubs.Add tmpArr(j), tmpArr2
     tmpArr(j) = tmpSubs.Item(tmpArr(j))

'2---------------
   next
   tmpSubs.RemoveAll

    userSubs.Add allInfo(0,i), tmpArr
  end if
 next

function getSubs(nme)
 arr = ("d","e","f")
 getSubs = arr
end function


To get it out, I'm using the items.
The end result looks like this:
1= 3
2= 3*
3= 0 = True** (True means that there is an array, but with ubound = 0)


a = userSubs.Items
For i = 0 To userSubs.Count -1
 response.Write("1= " & ubound(a(i)) & "<BR>")
 for j = 0 to ubound(a(i))-1
  response.Write("2= " & ubound(a(i)(j)) & "*<BR>")
  for k = 0 to ubound(a(i)(j))-1
   response.Write("3= " & ubound(a(i)(j)(k)) & " = ")
    response.Write(isArray(a(i)(j)(k)) & "**<BR>")
  next
 next
response.Write("<BR>")
Next

I want to write/get the information out so it looks like:
tmpArr = ((("d","e","f"), ("d","e","f"),
("d","e","f")), (("d","e","f"),
("d","e","f"), ("d","e","f")) ,
(("d","e","f"), ("d","e","f"),
("d","e","f")))
I used "d,e,f", but the array will depend on database values, so I
cannot simply call for a("d").

Help will be appreciated.

2. Differentiate between Save And AutoSave

3. Differentiate between office products

i am creating an application that is available in outlook 2002, word 2002, 
and excel 2002. my question is how can i tell what application i am in.  i 
use the connect.vb  with the code below but the applicationObject is just a 
System.__ComObject.  I hope that makes sense.

Thanks


Dim applicationObject As Object

Public Sub OnDisconnection(ByVal RemoveMode As 
Extensibility.ext_DisconnectMode, ByRef custom As System.Array) Implements 
Extensibility.IDTExtensibility2.OnDisconnection
        On Error Resume Next
        If RemoveMode <> 
Extensibility.ext_DisconnectMode.ext_dm_HostShutdown Then _
           Call OnBeginShutdown(custom)

        applicationObject = Nothing
End Sub


Private Sub MyButton_Click(ByVal Ctrl As 
Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean) 
Handles MyButton.Click
        If MainForm Is Nothing Then
            MainForm = New frmLauncher(applicationObject)
        End If
        MainForm.Show()
End Sub

4. Differentiate between Upper and Lower case characters - Microsoft Office

5. Grammer check should differentiate between "mean" and "means"

6. differentiate a line break from a paragraph break - Word Document management

7. Differentiating between my macros on Quick Access Toolbar

I have about 1/2 doz macros saved onto the Quick Access Toolbar but need to 
differentiate between them -- how do I assign an icon/create an icon to 
diferrentiate them from each other.  I'm sick of guessing and hitting the 
wrong macro !

8. How to differentiate by color changes made by different review - Word Document management