Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify translation of PRONOM signature to regex #98 #99

Merged
merged 1 commit into from
Jun 27, 2017

Conversation

mbhopton
Copy link
Contributor

@mbhopton mbhopton commented Mar 3, 2017

Prevent regex where max repetitions is less than min repetitions. I've set maxoffset to None which means it is not added to the regex. An alternative would be to set it to offset.

I tested with a single PUID since I get an URL error when trying to do fido-prepare on the whole file, leading to the need to prevent the "has_priority_over" check when a puid_filter is used.

Also correct some truth tests "is not None".

Prevent regex where max repetitions is less than min repetitions.
@mistydemeo
Copy link
Contributor

I get an URL error when trying to do fido-prepare on the whole file

This should be fixed by #101.

@jhsimpson
Copy link
Contributor

Fido 1.3.6 release

@sevein
Copy link
Contributor

sevein commented Jun 26, 2017

Here's a diff of the generated fido/conf/formats-v90.xml. @mbhopton, your changes seem to be working great! I've verified that the new regexes are correct:

diff --git a/fido/conf/formats-v90.xml b/fido/conf/formats-v90.xml
index cf5f5ee..fd9e36d 100644
@@ -41409,7 +41409,7 @@ Operational Pattern “OP-Atom” is intended to satisfy the demands of
       <pattern>
         <position>BOF</position>
         <pronom_pattern>66726565{12}69637066</pronom_pattern>
-        <regex>(?s)\A.{4,0}free.{12}icpf</regex>
+        <regex>(?s)\A.{4}free.{12}icpf</regex>
       </pattern>
     </signature>
     <details>
@@ -41439,7 +41439,7 @@ Operational Pattern &#8220;OP-Atom&#8221; is intended to satisfy the demands of
       <pattern>
         <position>BOF</position>
         <pronom_pattern>6E693100</pronom_pattern>
-        <regex>(?s)\A.{344,0}ni1\x00</regex>
+        <regex>(?s)\A.{344}ni1\x00</regex>
       </pattern>
     </signature>
     <details>

Full diff: https://gist.github.com/sevein/83ba5152d4d65704f7693d7750c12492.

@sevein sevein self-requested a review June 26, 2017 20:45
@sevein sevein added this to the 1.3.6 milestone Jun 26, 2017
@sevein
Copy link
Contributor

sevein commented Jun 26, 2017

This closes #98.

@sevein sevein mentioned this pull request Jun 26, 2017
@jhsimpson jhsimpson merged commit 3a4e5f5 into openpreserve:master Jun 27, 2017
@sevein sevein mentioned this pull request Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants