Comments (3)
Issue 1 could be solved by extracting paragraph instead of text elements, then merging all the text elements of each paragraph into a single string. You can split the paragraph if you would rather detect the source language and translate by sentence.
The downside is that all formatting is lost. Perhaps the TranslateArray2 method, which returns alignment information, could be used to restore the original formatting in the translated string.
from documenttranslator-legacy.
Right now TranslateArray2 doesn't support neural network translation, which puts a slight hamper on that approach.
For issue 2: yesterday I modified the detection as described above. It now processes the entire document first with "DetectArray", then filters out any array elements where the detected language matches the target language for the translation. Then it passes only the remaining elements through the translation, and updates the documents with the translations for those elements.
It seems like a decent approach, and anecdotally it appears to have resolved my issue with this one German document. We need to see how it performs on a wider variety of documents to determine if it's a scalable approach.
from documenttranslator-legacy.
@jsypkens, did your approach succeed? Do you want to make a pull request with your change?
from documenttranslator-legacy.
Related Issues (20)
- Document Translator - Footnotes in Word document not translated HOT 1
- "key invalid" if incorrect regions are selected although the key is actually valid. HOT 2
- Document translator - NAVIGATION FAILED (error message)
- Document Translator - Error message: RPC server unavailable
- Document Translator - Error message: Invalid Hyperlink
- Warning on invalid Category ID
- Cannot translate an HTML file without <body>
- F-DROID Possible? HOT 5
- Why did I fail to finish the code build? HOT 4
- System incompatibility since 2.1.1 HOT 1
- Translate HOT 1
- Issue in PDF translation HOT 3
- Can any other cloud service provider be used for translation part HOT 1
- The language list not fully loaded in From/to Language dropdown HOT 2
- Set series colors in column charts HOT 1
- Document Translator V2.9.2 throwing error with Category ID
- SRT/VTT translation returns error HOT 1
- Error running under Windows 7 HOT 1
- X-WMF TO PNG HOT 1
- failed to translate html file with MS document translator HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documenttranslator-legacy.