Verification API Global Verifier

Hello,

I have a requirement to build a global verifier similar to QA checker. The only difference is I need to verify the length of a segment in pixels, not characters.

There are System.Drawing.Graphics functions I can use to calculate the width according to font and size in the verification logic. My problem is where to start building a global verifier and what part of the verification API gives me access to the maxwidth values in the xliff file as well as the header part of the xliff file.

I currently have in front of me the sample project Sdl.Verification.Sdk.IdenticalCheck.Extended.

Sven

Parents
  • Here is some initial comment from development;

    • For length verification we have a special context which is added to the SDL XLIFF by filters (TMMatchContextTypes.LengthInformation in Sdl.FileTypeSupport.Framework.Core.Utilities.NativeApi namespace) so the verifier needs to check the paragraph unit for this specific context and get the information about allowed length from it.

    The information is stored as metadata in this context and can be retrieved as follows:

    • context.GetMetaData(MetaDataTypes.MinValue)

    • context.GetMetaData(MetaDataTypes.MaxValue)

    • I don’t think any of our filters actually supports any other units than characters so in first place I would need to know which file type be able to help more.

    Feel free to get back to me with further questions and more detail to allow the developer to opine further.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • I am working with xliff files. The help regarding context and paragraph unit makes sense, but I m unable to

    find the context TMMatchContextTypes in sdl.FileTypeSupport.Framework.Core.Utilities.NativeApi.

    I am trying to hook this into a framework similar to the approach taken in the sample solution Verification.Sdk.IdenticalCheck, file IdenticalVerifierMain, method CheckParagraphUnit.

    Sven

  • Ok, so I think I am on the right track by having referenced the Sdl.FileTypeSupport.Framework.Core.Utilities.dll, using "using Sdl.FileTypeSupport.Framework.Core.Utilities.NativeApi", and accessing the maxlength via Interface  IContextInfo

    private void CheckParagraphUnit(IParagraphUnit paragraphUnit, IContextInfo paragraphContextInfo)

           {

                string paragraphMaxLength = paragraphContextInfo.GetMetaData(MetaDataTypes.MinValue);

    ....

Reply Children
No Data