How to search for segment that does NOT contain something (online project) Thread poster: Neil Allen
| Neil Allen France Local time: 02:25 Member French to English
I would like to know the correct procedure for filtering on a negative case, meaning something that is NOT there. For example, imagine I have a particular word that should have a full stop after it, but there are many instances where this full stop is missing. In a local project, I would filter for the word with the full stop and lock all the segments. Then I would filter on all unlocked segments looking for just the word. This would show me al... See more I would like to know the correct procedure for filtering on a negative case, meaning something that is NOT there. For example, imagine I have a particular word that should have a full stop after it, but there are many instances where this full stop is missing. In a local project, I would filter for the word with the full stop and lock all the segments. Then I would filter on all unlocked segments looking for just the word. This would show me all the segments that do not have the full stop after it. The above works perfectly, but what can be done in online projects where it is not possible to lock segments? I could change the status to "edited", "not started" or "pretranslated" but this would mess up the entire project. Does anyone have any suggestions concerning how to perform such a "negative search" in an online project? ▲ Collapse | | | William Tierney United States Local time: 20:25 Member (2002) Arabic to English REGEX to the rescue | Dec 6, 2022 |
Hi Neil, This sounds like a job for regular expressions (REGEX). I have used it for various filters in both the target and source columns. MemoQ has a series of tutorials, and there are other tutorials out there. It takes a bit for a "word person" to get their head rapped around the symbolic logic aspects of REGEX, but it is a powerful tool. | | | Neil Allen France Local time: 02:25 Member French to English TOPIC STARTER There probably is a solution with REGEX | Dec 6, 2022 |
Hi William, I think you are right, but the difficulty lies in searching for what is NOT there, rather than what IS there. It appears it can be done with a negative lookahead. Thanks for your reply! | | | Stepan Konev Russian Federation Local time: 03:25 English to Russian Regular expressions | Dec 6, 2022 |
Try this regular expression that will filter all segments that do not contain 'word.' (your case): ^(?>(?!word\.).)*$ For this regex you also need to type the source term for memoQ to narrow down the scope of filtering: Source filter: (?i)mot Target filter: ^(?>(?!word\.).)*$ (?i) means non case sensitive, i.e. it includes mot and Mot. If you suppose that your target segments may contain the 'word(.)' but not the source equiva... See more Try this regular expression that will filter all segments that do not contain 'word.' (your case): ^(?>(?!word\.).)*$ For this regex you also need to type the source term for memoQ to narrow down the scope of filtering: Source filter: (?i)mot Target filter: ^(?>(?!word\.).)*$ (?i) means non case sensitive, i.e. it includes mot and Mot. If you suppose that your target segments may contain the 'word(.)' but not the source equivalent 'mot(.)', then you can use this for the target filter: (?i)word[^\.]|(?i)word$ === Another regex that may be useful too filters segments that include word1 but do not include word2 (not your case but just in case): ^(?!.*(\bword2\b)).*(\bword1\b).*
[Edited at 2022-12-06 20:42 GMT] ▲ Collapse | |
|
|
Neil Allen France Local time: 02:25 Member French to English TOPIC STARTER Another solution | Dec 6, 2022 |
Thanks, Stepan. In case this comes up again, it can also be done with a negative lookahead. investment(?!\.) will find all instances of the word "investment" without a following full stop. Many thanks for your input.
[Edited at 2022-12-06 21:18 GMT] | | | To report site rules violations or get help, contact a site moderator: You can also contact site staff by submitting a support request » How to search for segment that does NOT contain something (online project) Anycount & Translation Office 3000 | Translation Office 3000
Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.
More info » |
| Protemos translation business management system | Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!
The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.
More info » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |