473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Pattern Matching

PhilOfWalton
1,430 Expert 1GB
I am using Google Translate to translate Combo Box Value Lists from say German to English

This is the input string:-
1;"Englisch";"en";2;"Französisch";"fr";3;"Deutch"; "de";4;"Spanisch";"es";5;"Russisch";"ru";6;"Mongol isch";"mn"

This is the output string:-
1, "english", "s", 2, "french", "fr", 3, "deutch"; "de", 4, "spanish", "it", 5, "russian", "ru"; 6; "mongolian"; "mn"

As you may notice, some of the semicolons in the input string have been transformed into commas.

Now obviously a replace function would work in this case, but if there was a comma within the quoted word that would be incorrectly changed.

Any ideas please?

Phil
Sep 3 '17 #1

✓ answered by NeoPa

Of course, no sooner did I post that last one than I found it - RegEx Discussion.

5 2316
NeoPa
32,556 Expert Mod 16PB
Not sure what the task is here Phil. I can't see why some are left as semi-colons while others are converted to commas.

That aside though, have you considered using Regular Expressions? I believe there was a thread about that a while back but rather unfortunately (stupidly) I didn't make a note of it at the time in my database.
Sep 3 '17 #2
NeoPa
32,556 Expert Mod 16PB
I can't find an earlier discussion I was involved in but here's a link that may help - Regular Expressions in VBA.
Sep 3 '17 #3
NeoPa
32,556 Expert Mod 16PB
Of course, no sooner did I post that last one than I found it - RegEx Discussion.
Sep 3 '17 #4
PhilOfWalton
1,430 Expert 1GB
Thanks, NeoPa, sorry for the delay in replying. Have really been struggling with this Db.

To cut a long story short, in a moment of madness, I offered to help a chap who wanted a multi-lingual database. Then I thought further and decided to develop it as as some form of Access add-on to convert any Db to a different language. I'm pretty well on with it an that I can translate most of the fixed information on forms and reports into different languages, as well as combo boxes using semi- fixed information (Language being an obvious one)

I build a table of things like label captions, command captions, Page captions, form captions, control tip text, status bar and as mentioned, Combo box drop downs.

The original database was written in German.

I use Google Translate to automatically translate the above into the required language, and op opening the forms & reports, apply the translated words.

The original question shows a Value List from a German Combo Box, and Google's attempt at translating it.

I wasn't aware of Regex and will have look at that a bit later on. For the moment I can correct manually, but I need to press on ironing out bugs.

Thanks again

Phil
Sep 5 '17 #5
Rabbit
12,516 Expert Mod 8TB
The long term solution would be to use regex to strip out a listing of all words without punctuation or minimal punctuation, translate that, and use regex to insert it back into the original format.

A short term workaround for this particular issue could be to split the string on the semi-colon, loop each option through the translation, and rebuild the string. Or do a search and replace on """, """.
Sep 5 '17 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: gsv2com | last post by:
One of my weaknesses has always been pattern matching. Something I definitely need to study up on and maybe you guys can give me a pointer here. I'm looking to remove all of this code and just...
176
by: Thomas Reichelt | last post by:
Moin, short question: is there any language combining the syntax, flexibility and great programming experience of Python with static typing? Is there a project to add static typing to Python? ...
9
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # Matching string patterns # # Sometimes you want to know if a string is of # particular pattern. Let's say in your website # you have converted all images...
4
by: Xah Lee | last post by:
20050207 text pattern matching # -*- coding: utf-8 -*- # Python # suppose you want to replace all strings of the form # <img src="some.gif" width="30" height="20"> # to # <img...
1
by: Henry | last post by:
I have a table that stores a list of zip codes using a varchar column type, and I need to perform some string prefix pattern matching search. Let's say that I have the columns: 94000-1235 94001...
10
by: bpontius | last post by:
The GES Algorithm A Surprisingly Simple Algorithm for Parallel Pattern Matching "Partially because the best algorithms presented in the literature are difficult to understand and to implement,...
5
by: olaufr | last post by:
Hi, I'd need to perform simple pattern matching within a string using a list of possible patterns. For example, I want to know if the substring starting at position n matches any of the string I...
9
by: Jim Lewis | last post by:
Anyone have experience with string pattern matching? I need a fast way to match variables to strings. Example: string - variables ============ abcaaab - xyz abca - xy eeabcac - vxw x...
2
by: Ole Nielsby | last post by:
First, bear with my xpost. This goes to comp.lang.c++ comp.lang.functional with follow-up to comp.lang.c++ - I want to discuss an aspect of using C++ to implement a functional language, and...
1
by: VanKha | last post by:
I write this program for pattern-matching,but it gives wrong result: #include<iostream> #include<conio.h> #include<string.h> using namespace std; main() { char text,pat;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.