Menu

#1594 Improve support for markup in DSL dictionaries

5.7
closed-fixed
None
2
2021-11-18
2021-08-05
Gabix
No

In the DSL markup language, square brackets [ and ] are used to mark formatting tags. When you need to show square brackets in a dictionary article, you have to duplicate them, i. e. to put in [[ and ]]. However, OmegaT‘s DSL parser seemingly tries to process everything between duplicated square brackets as tags and just drops the content when showing an article in the dictionary pane.

Steps to reproduce:

  1. Unpack and open the attached sample project in OmegaT.

It has only one segment matching an article in the dictionary supplied. The article contains two transcription areas: [t][[yī ge yàng]][/t] and [t]yī yàng[/t].

  1. Open the dictionary pane to see that the first transcription area disappears with only a bare ] left, while the second transcription area is shown.
1 Attachments

Related

Feature Requests: #1593

Discussion

1 2 > >> (Page 1 of 2)
  • Hiroshi Miura

    Hiroshi Miura - 2021-08-18

    I've confirmed that the behavior is reproduced with attached test case.
    An expected output may be as followings; that is copied from GoldenDict.

    一个样
    [yī ge yàng]
    same as 一樣|一样 yī yàng, the same
    
     
    • Hiroshi Miura

      Hiroshi Miura - 2021-08-18

      Current implementation defines skip RE

          protected static final Pattern RE_SKIP = Pattern.compile("\\[.+?\\]");
      
       
  • Gabix

    Gabix - 2021-08-20

    As far as I understand this code, it is a sort of ‘kill-em-all’ approach.

    I downloaded the 5.5.0 source code, opened in NetBeans 8.0.2 and tried to modify the code to specifically list DSL tags as follows (it won’t be a good solution, though):

    protected static final Pattern RE_SKIP = Pattern.compile("\\[[b|/b|i|/i|u|/u|c|/c|sup|/sup|sub|/sub|m|/m|m1|/m1|m2|/m2|m3|/m3|'|/'|br|p|/p|t|/t|\\*|/\\*|ex|/ex|com|/com|trn|/trn|trn1|/trn1|\\!trs|/\\!trs|lang|/lang|s|/s|video|/video|ref|/ref|url|/url]\\]");
    

    However, trying to build the project, I got an error message with the stack trace as follows (sorry, I can’t understand how to make it collapsible):

    ```
    Issue 1


    Requested project: E:\Distrib\Programs\OmegaT\OmegaT_5.5.0_Beta_Source

    Stack trace:
    org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-6.6.1-bin.zip'.
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:63)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
    at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:72)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.runBuild(AsyncGradleTask.java:369)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgressIgnoreTaskDefCancel(AsyncGradleTask.java:492)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgressIgnoreTaskDefCancel(AsyncGradleTask.java:402)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgress(AsyncGradleTask.java:393)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask.access$400(AsyncGradleTask.java:84)
    at org.netbeans.gradle.project.tasks.AsyncGradleTask$BuildExecutionItem$1.run(AsyncGradleTask.java:775)
    at org.netbeans.gradle.project.tasks.GradleDaemonManager.runNonBlockingGradleTask(GradleDaemonManager.java:36)
    at org.netbeans.gradle.project.tasks.GradleDaemonManager.access$100(GradleDaemonManager.java:23)
    at org.netbeans.gradle.project.tasks.GradleDaemonManager$2.execute(GradleDaemonManager.java:126)
    at org.jtrim.concurrent.AbstractTaskExecutorService$FunctionWrapper.execute(AbstractTaskExecutorService.java:270)
    at org.jtrim.concurrent.AbstractTaskExecutorService$TaskOfAbstractExecutor.execute(AbstractTaskExecutorService.java:340)
    at org.jtrim.concurrent.Tasks$RunOnceCancelableTask.execute(Tasks.java:342)
    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$QueuedItem.runTask(ThreadPoolTaskExecutor.java:1213)
    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker.executeTask(ThreadPoolTaskExecutor.java:1049)
    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker.run(ThreadPoolTaskExecutor.java:1179)
    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker$1.run(ThreadPoolTaskExecutor.java:998)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: org.gradle.tooling.UnsupportedVersionException: Support for clients using a tooling API version older than 3.0 was removed in Gradle 5.0. You are currently using tooling API version 2.10. You should upgrade your tooling API client to version 3.0 or later.
    at org.gradle.tooling.internal.provider.DefaultConnection.unsupportedConnectionException(DefaultConnection.java:275)
    at org.gradle.tooling.internal.provider.DefaultConnection.checkUnsupportedTapiVersion(DefaultConnection.java:289)
    at org.gradle.tooling.internal.provider.DefaultConnection.validateAndConvert(DefaultConnection.java:266)
    at org.gradle.tooling.internal.provider.DefaultConnection.getModel(DefaultConnection.java:200)
    at org.gradle.tooling.internal.consumer.connection.CancellableModelBuilderBackedModelProducer.produceModel(CancellableModelBuilderBackedModelProducer.java:58)
    at org.gradle.tooling.internal.consumer.connection.PluginClasspathInjectionSupportedCheckModelProducer.produceModel(PluginClasspathInjectionSupportedCheckModelProducer.java:41)
    at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:58)
    at org.gradle.tooling.internal.consumer.DefaultBuildLauncher$1.run(DefaultBuildLauncher.java:84)
    at org.gradle.tooling.internal.consumer.DefaultBuildLauncher$1.run(DefaultBuildLauncher.java:78)
    at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:83)
    at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
    at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsuproceedmerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    ... 1 more
    ```

    I don’t understand how to procede further.

     
    • Hiroshi Miura

      Hiroshi Miura - 2021-09-04

      @Gabix Thank you for proposal.
      I'd tested with your regex string and got a result as follows.

      一个样 - [[yī ge yàng]][/t] [trn]same as 一樣|一样  yàng[/t], the same[/trn]
      
       

      Last edit: Hiroshi Miura 2021-09-04
  • Hiroshi Miura

    Hiroshi Miura - 2021-09-04

    Attached patch brings an expected result.

    一个样 - [yī ge yàng] same as 一樣|一样 yī yàng, the same
    

    Main part of fix is

    static {
    RE_MAP.add(new RegMap("\b\\[/b\]", "\<strong>$1\</strong>"));
    RE_MAP.add(new RegMap("\i\\[/i\]", "\<span style='font-style: italic'>$1\</span>"));
    RE_MAP.add(new RegMap("\[trn\]", ""));
    RE_MAP.add(new RegMap("\[/trn\]", ""));
    RE_MAP.add(new RegMap("\[t\]", ""));
    RE_MAP.add(new RegMap("\[/t\]", ""));
    }

    @Gabix could you add more tags replacement here?

     

    Last edit: Hiroshi Miura 2021-09-04
    • Hiroshi Miura

      Hiroshi Miura - 2021-09-04
       
    • Hiroshi Miura

      Hiroshi Miura - 2021-09-04
       
  • Gabix

    Gabix - 2021-09-07

    I have added more tag replacements as follows (I commented some cases when tags are not just dropped:

        static {
            RE_MAP.add(new RegMap("\\[b\\](.+?)\\[/b\\]", "<strong>$1</strong>"));
            RE_MAP.add(new RegMap("\\[i\\](.+?)\\[/i\\]", "<span style='font-style: italic'>$1</span>"));
            RE_MAP.add(new RegMap("\\[trn\\]", ""));
            RE_MAP.add(new RegMap("\\[/trn\\]", ""));
            RE_MAP.add(new RegMap("\\[t\\]", ""));
            RE_MAP.add(new RegMap("\\[/t\\]", ""));
    +        RE_MAP.add(new RegMap("\\[br\\]", "<br/>"));
    +        //The following line tries to replace [c]text[/c] with green text (default color in Lingvo)
    +        RE_MAP.add(new RegMap("\\[c\\](.+?)\\[/c\\]", "<span style='color:green'>$1</span>"));
    +        //The following line tries to replace [c value]text[/c] with text colored as per the value. Since the color names are plain words like 'red', or 'blue', or 'steelgray' etc., I use the ([a-z]+?) regular expression, but am not sure if it is correct.
    +        RE_MAP.add(new RegMap("\\[c\s([a-z]+?)\\](.+?)\\[/c\\]", "<span style='color:$1'>$2</span>"));
    +        RE_MAP.add(new RegMap("\\[com\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/com\\]", ""));
    +        RE_MAP.add(new RegMap("\\[ex\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/ex\\]", ""));
    +        RE_MAP.add(new RegMap("\\[lang\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/lang\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m1\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m1\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m2\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m2\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m3\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m3\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m4\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m4\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m5\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m5\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m6\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m6\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m7\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m7\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m8\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m8\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m9\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m9\\]", ""));
    +        RE_MAP.add(new RegMap("\\[p\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/p\\]", ""));
    +        RE_MAP.add(new RegMap("\\[preview\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/preview\\]", ""));
    +        RE_MAP.add(new RegMap("\\[ref\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/ref\\]", ""));
    +        RE_MAP.add(new RegMap("\\[s\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/s\\]", ""));
    +        //The following line tries to replace [sub]text[/sub] with subscript text
    +        RE_MAP.add(new RegMap("\\[sub\\](.+?)\\[/sub\\]", "<sub>$1</sub>"));
    +        //The following line tries to replace [sup]text[/sup] with superscript text
    +        RE_MAP.add(new RegMap("\\[sup\\](.+?)\\[/sup\\]", "<sup>$1</sup>"));
    +        RE_MAP.add(new RegMap("\\[trn1\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/trn1\\]", ""));
    +        RE_MAP.add(new RegMap("\\[trs\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/trs\\]", ""));
    +        // In the following two lines, the exclamation marks are escaped. Maybe, it is superfluous.
    +        RE_MAP.add(new RegMap("\\[\\!trs\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/\\!trs\\]", ""));
    +        //The following line tries to replace [u]text[/u] with underlined text
    +        RE_MAP.add(new RegMap("\\[u\\](.+?)\\[/u\\]", "<span style='text-decoration:underline'>$1</span>"));
    +        //The following line tries to replace [url]text[/url] with a hyperlink
    +        RE_MAP.add(new RegMap("\\[url\\](.+?)\\[/url\\]", "<a href='$1'>$1</a>"));
    +        RE_MAP.add(new RegMap("\\[video\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/video\\]", ""));
    +        //The following line tries to replace a letter surrounded by ['][/'] tags (indicating stress) with a red letter (the default behavior in Lingvo). Check the syntax: does ' need to be escaped?
    +        RE_MAP.add(new RegMap("\\['\\].[/'\\]", "<span style='color:red'>$1</span>"));
    +        // In the following two lines, the asterisk symbols are escaped. Maybe, it is superfluous.
    +        RE_MAP.add(new RegMap("\\[\\*\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/\\*\\]", ""));
        }
    
     
    • Hiroshi Miura

      Hiroshi Miura - 2021-09-12

      Pull-Request https://github.com/omegat-org/omegat/pull/145 is updated with the contribution (w/ some fix). Now ready for review & merge.

       
    • Hiroshi Miura

      Hiroshi Miura - 2021-09-14

      @Gabix

      Could you tell us how the these six test data should be converted with your new rules?
      There is a test data in OmegaT project, and we need to make expectations for the test.

      And when it is possible, could you add more test cases, source data and expectations, to check your new rules?

      #NAME "Test (En-Ru)"
      #INDEX_LANGUAGE "English"
      #CONTENTS_LANGUAGE "Russian"
      
      
      space
       [m1][trn]Only a single white space on first character[/trn][/m]
      
      
      tab
          [m1][trn]Translation line also can have a single TAB char[/trn][/m]
      
      
      tag
       [m1][trn]tag should be ignored[/trn][/m]
      
      
      test
          [m1][trn]контрольная работа[/trn][/m]
      
      
      time
       [m1][trn]время[/trn][/m]
      
      
      tool
       [m1][trn]станок[/trn][/m]
      
       

      Last edit: Hiroshi Miura 2021-09-14
  • Hiroshi Miura

    Hiroshi Miura - 2021-09-15

    From the website http://lingvo.helpmax.net/en/troubleshooting/dsl-compiler/dsl-tags/

    [m] – sets the left paragraph margin. N is the number of spaces which will be used for the left-hand margin. N must be within the range from 0 to 9. The corresponding closing tag of the paragraph is [/m]. and left card margin.

    Are there right the m1 - m9 rules?

     
  • Gabix

    Gabix - 2021-09-15

    Yes, these rules are correct. However, since OmegaT shows dictionary articles as single lines anyway, processing the mX tags seems excessive, so I suggested omitting them in the above piece of code in the following part:

    +        RE_MAP.add(new RegMap("\\[m\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m1\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m1\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m2\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m2\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m3\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m3\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m4\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m4\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m5\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m5\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m6\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m6\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m7\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m7\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m8\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m8\\]", ""));
    +        RE_MAP.add(new RegMap("\\[m9\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m9\\]", ""));
    

    and add two more lines:

    +        RE_MAP.add(new RegMap("\\[m0\\]", ""));
    +        RE_MAP.add(new RegMap("\\[/m0\\]", ""));
    

    I haven't seen any case of usage of the m0 tag in real dictionaries, though.

    Or are you trying to implement fancy display of dictionary articles? Then here is a sample of DSL code of an article both with m1 and m2 tags :

    abandon
        [m1][b]1.[/b] [trn]отказываться [com]([i]от чего-л.[/i])[/com], прекращать [com]([i]попытки и т. п.[/i])[/com][/trn][/m]
        [m1][b]2.[/b] [trn]покидать, оставлять[/trn][/m]
        [m2]to [ref]abandon attempts[/ref][/m]
        [m2]to [ref]abandon a claim[/ref][/m]
        [m2]to [ref]abandon convertibility[/ref][/m]
        [m2]to [ref]abandon the gold standard[/ref][/m]
        [m2]to [ref]abandon price control[/ref][/m]
        [m2]to [ref]abandon a right[/ref][/m]
    

    See the attached PNG file showing how it looks in GoldenDict (and should look in ABBYY Lingvo, but I don't have the latter).

     

    Last edit: Gabix 2021-09-15
    • Hiroshi Miura

      Hiroshi Miura - 2021-09-15

      I'd like to add single indent for m2, no indent for m, m1 and two indents for m3-m9.
      Is it reasonable?

       
  • Gabix

    Gabix - 2021-09-15

    I’d suggest no indent for m0, single indent for m and m1, double indent for m2, triple for the rest, as follows:

            RE_MAP.add(new RegMap("\\[m0\\](.+?)\\[/m0\\]", "<p>$1</p>"));
             RE_MAP.add(new RegMap("\\[m\\](.+?)\\[/m\\]", "<p style="text-indent: 30px">$1</p>"));
            RE_MAP.add(new RegMap("\\[m1\\](.+?)\\[/m1\\]", "<p style="text-indent: 30px">$1</p>"));
            RE_MAP.add(new RegMap("\\[m2\\](.+?)\\[/m2\\]", "<p style="text-indent: 60px">$1</p>"));
            RE_MAP.add(new RegMap("\\[m3\\](.+?)\\[/m3\\]", "<p style="text-indent: 90px">$1</p>"));
            RE_MAP.add(new RegMap("\\[m4\\](.+?)\\[/m4\\]", "<p style="text-indent: 90px">$1</p>"));
            RE_MAP.add(new RegMap("\\[m5\\](.+?)\\[/m5\\]", "<p style="text-indent: 90px">$1</p>"));
            RE_MAP.add(new RegMap("\\[m6\\](.+?)\\[/m6\\]", "<p style="text-indent: 90px">$1</p>"));
            RE_MAP.add(new RegMap("\\[m7\\](.+?)\\[/m7\\]", "<p style="text-indent: 90px">$1</p>"));
            RE_MAP.add(new RegMap("\\[m8\\](.+?)\\[/m8\\]", "<p style="text-indent: 90px">$1</p>"));
            RE_MAP.add(new RegMap("\\[m9\\](.+?)\\[/m9\\]", "<p style="text-indent: 90px">$1</p>"));
    
     
    • Hiroshi Miura

      Hiroshi Miura - 2021-09-22

      Could you try this?

       
      • Hiroshi Miura

        Hiroshi Miura - 2021-09-22

        this version convert test data

        abandon
            [m1][b]1.[/b] [trn]отказываться [com]([i]от чего-л.[/i])[/com], прекращать [com]([i]попытки и т. п.[/i])[/com][/trn][/m]
            [m1][b]2.[/b] [trn]покидать, оставлять[/trn][/m]
            [m2]to [ref]abandon attempts[/ref][/m]
            [m2]to [ref]abandon a claim[/ref][/m]
            [m2]to [ref]abandon convertibility[/ref][/m]
            [m2]to [ref]abandon the gold standard[/ref][/m]
            [m2]to [ref]abandon price control[/ref][/m]
            [m2]to [ref]abandon a right[/ref][/m]
        

        into expectation

                assertEquals("<p style=\"text-indent: 30px\"><strong>1.</strong> \u043E\u0442\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C\u0441\u044F" +
                                " (<span style='font-style: italic'>\u043E\u0442 \u0447\u0435\u0433\u043E-\u043B.</span>)," +
                                " \u043F\u0440\u0435\u043A\u0440\u0430\u0449\u0430\u0442\u044C " +
                                "(<span style='font-style: italic'>\u043F\u043E\u043F\u044B\u0442\u043A\u0438 \u0438 \u0442." +
                                " \u043F.</span>)</p>\n" +
                                "<p style=\"text-indent: 30px\"><strong>2.</strong> \u043F\u043E\u043A\u0438\u0434\u0430\u0442\u044C," +
                                " \u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0442\u044C</p>\n" +
                                "<p style=\"text-indent: 60px\">to abandon attempts</p>\n" +
                                "<p style=\"text-indent: 60px\">to abandon a claim</p>\n" +
                                "<p style=\"text-indent: 60px\">to abandon convertibility</p>\n" +
                                "<p style=\"text-indent: 60px\">to abandon the gold standard</p>\n" +
                                "<p style=\"text-indent: 60px\">to abandon price control</p>\n" +
                                "<p style=\"text-indent: 60px\">to abandon a right</p>\n",
                        result.get(0).getArticle());
        
         
  • Gabix

    Gabix - 2021-09-22

    本当にクールですよ!

    I’ve tested the binary with a couple of dictionaries and find it excellent. Dictionary articles appear fine. I will test further, but so far I can’t see anything that would need an immediate correction, except for one thing: in some dictionaries, square brackets are escaped as \[ and \]. Escaping works similarly to bracket duplication. Now, they appear as \[ and \] respectively instead of just [ and ]. Attaching a test case.

    P. S. Sorry, I did not report it earlier. I guess, I missed it because they simply disappeared.

     

    Last edit: Gabix 2021-09-22
    • Hiroshi Miura

      Hiroshi Miura - 2021-09-22

      Thank you for the feedback. An idea to solve \[ case is welcome!

       
      • Hiroshi Miura

        Hiroshi Miura - 2021-09-22

        I have an idea to replace \[ to &#91;

         
  • Gabix

    Gabix - 2021-09-23

    Maybe, \[ as &lbrack; and \] as &rbrack;?

     
    • Hiroshi Miura

      Hiroshi Miura - 2021-09-23

      got it, IMO, it is ready for review.

       
      • Gabix

        Gabix - 2021-09-23

        Oops, my suggestion does not work. The &lbrack; and &rbrack; codes show up literally, not converted to brackets (attaching a screenshot). Perhaps, using &#91; and &#93;, as per your suggestion, would work better.

         
        • Hiroshi Miura

          Hiroshi Miura - 2021-09-25

          got it.

           
          • Gabix

            Gabix - 2021-09-25

            The brackets are fixed now, great!

            Now, I can see a minor issue: some colors are reproduced when specified as the values of the c tag, some are not.

            In the above test case:
            a) red, blue, fuchsia, gray, purple, green are fine;
            b) darkviolet, midnightblue, indigo, darkred turn into black.

            As far as I understand, the DSL markup uses standard HTML color names. I will test further.

             
            • Gabix

              Gabix - 2021-11-09

              So, here is one more report.

              DSL supports a variety of colors for the [c] tag. However, OmegaT shows only the following:
              aqua
              blue
              fuchsia
              gray
              green
              lime
              maroon
              navy
              olive
              orange
              purple
              red
              silver
              teal
              white
              yellow

              All other colors turn into black (tested with the binaries of 22 and 25 September from this thread).

              To reproduce, open the attached project and see the dictionary tab (if you fetch the dictionary to GoldenDict, you’ll see the whole palette).

              The question is: where is the limitation? OmegaT? Java?

               

              Last edit: Gabix 2021-11-09
1 2 > >> (Page 1 of 2)

Log in to post a comment.